tests/brightbox/requests/compute/server_tests.rb in fog-maestrodev-1.15.0.20130829165835 vs tests/brightbox/requests/compute/server_tests.rb in fog-maestrodev-1.15.0.20130927082724

- old
+ new

@@ -9,73 +9,76 @@ tests("#create_server(:image => '#{image_id}')") do pending if Fog.mocking? result = Fog::Compute[:brightbox].create_server(:image => image_id) server_id = result["id"] - formats(Brightbox::Compute::Formats::Full::SERVER, false) { result } + data_matches_schema(Brightbox::Compute::Formats::Full::SERVER, {:allow_extra_keys => true}) { result } end unless Fog.mocking? Fog::Compute[:brightbox].servers.get(server_id).wait_for { ready? } end tests("#list_servers") do pending if Fog.mocking? result = Fog::Compute[:brightbox].list_servers - formats(Brightbox::Compute::Formats::Collection::SERVERS, false) { result } + data_matches_schema(Brightbox::Compute::Formats::Collection::SERVERS, {:allow_extra_keys => true}) { result } end tests("#get_server('#{server_id}')") do pending if Fog.mocking? result = Fog::Compute[:brightbox].get_server(server_id) - formats(Brightbox::Compute::Formats::Full::SERVER, false) { result } + data_matches_schema(Brightbox::Compute::Formats::Full::SERVER, {:allow_extra_keys => true}) { result } end tests("#update_server('#{server_id}')") do pending if Fog.mocking? result = Fog::Compute[:brightbox].update_server(server_id, :name => "Fog@#{Time.now.iso8601}") - formats(Brightbox::Compute::Formats::Full::SERVER, false) { result } + data_matches_schema(Brightbox::Compute::Formats::Full::SERVER, {:allow_extra_keys => true}) { result } end tests("#activate_console_server('#{server_id}')") do pending if Fog.mocking? result = Fog::Compute[:brightbox].activate_console_server(server_id) - formats(Brightbox::Compute::Formats::Full::SERVER, false) { result } + data_matches_schema(Brightbox::Compute::Formats::Full::SERVER, {:allow_extra_keys => true}) { result } + test("has set 'console_url'") { ! result["console_url"].empty? } + test("has set 'console_token'") { ! result["console_token"].empty? } + test("has set 'console_token_expires'") { ! result["console_token_expires"].empty? } end tests("#stop_server('#{server_id}')") do pending if Fog.mocking? result = Fog::Compute[:brightbox].stop_server(server_id) - formats(Brightbox::Compute::Formats::Full::SERVER, false) { result } + data_matches_schema(Brightbox::Compute::Formats::Full::SERVER, {:allow_extra_keys => true}) { result } end tests("#start_server('#{server_id}')") do pending if Fog.mocking? result = Fog::Compute[:brightbox].start_server(server_id) - formats(Brightbox::Compute::Formats::Full::SERVER, false) { result } + data_matches_schema(Brightbox::Compute::Formats::Full::SERVER, {:allow_extra_keys => true}) { result } end tests("#shutdown_server('#{server_id}')") do pending if Fog.mocking? result = Fog::Compute[:brightbox].shutdown_server(server_id) - formats(Brightbox::Compute::Formats::Full::SERVER, false) { result } + data_matches_schema(Brightbox::Compute::Formats::Full::SERVER, {:allow_extra_keys => true}) { result } end tests("#snapshot_server('#{server_id}')") do pending if Fog.mocking? result = Fog::Compute[:brightbox].snapshot_server(server_id) - formats(Brightbox::Compute::Formats::Full::SERVER, false) { result } + data_matches_schema(Brightbox::Compute::Formats::Full::SERVER, {:allow_extra_keys => true}) { result } # Server should be exclusively for our test so assume we can delete the snapshot snapshot_id = result["snapshots"].first["id"] @snapshot = Fog::Compute[:brightbox].images.get(snapshot_id) @snapshot.wait_for { ready? } @snapshot.destroy end tests("#destroy_server('#{server_id}')") do pending if Fog.mocking? result = Fog::Compute[:brightbox].destroy_server(server_id) - formats(Brightbox::Compute::Formats::Full::SERVER, false) { result } + data_matches_schema(Brightbox::Compute::Formats::Full::SERVER, {:allow_extra_keys => true}) { result } end end tests('failure') do