Permalink
Browse files

[Brightbox] Update format test to not fail on new attributes in JSON

  • Loading branch information...
1 parent 5eba750 commit f8c4900f92441c8d909207a913f2073f7bfd99f9 @tokengeek tokengeek committed Feb 6, 2012
@@ -5,21 +5,21 @@
tests("#get_account") do
pending if Fog.mocking?
result = Fog::Compute[:brightbox].get_account
- formats(Brightbox::Compute::Formats::Full::ACCOUNT) { result }
+ formats(Brightbox::Compute::Formats::Full::ACCOUNT, false) { result }
test("ftp password is blanked") { result["library_ftp_password"].nil? }
end
update_options = {:name => "Fog@#{Time.now.iso8601}"}
tests("#update_account(#{update_options.inspect})") do
pending if Fog.mocking?
result = Fog::Compute[:brightbox].update_account(update_options)
- formats(Brightbox::Compute::Formats::Full::ACCOUNT) { result }
+ formats(Brightbox::Compute::Formats::Full::ACCOUNT, false) { result }
end
tests("#reset_ftp_password_account") do
pending if Fog.mocking?
result = Fog::Compute[:brightbox].reset_ftp_password_account
- formats(Brightbox::Compute::Formats::Full::ACCOUNT) { result }
+ formats(Brightbox::Compute::Formats::Full::ACCOUNT, false) { result }
test("new ftp password is visible") { ! result["library_ftp_password"].nil? }
end
@@ -11,39 +11,39 @@
pending if Fog.mocking?
result = Fog::Compute[:brightbox].create_api_client(create_options)
@api_client_id = result["id"]
- formats(Brightbox::Compute::Formats::Full::API_CLIENT) { result }
+ formats(Brightbox::Compute::Formats::Full::API_CLIENT, false) { result }
end
tests("#list_api_clients") do
pending if Fog.mocking?
result = Fog::Compute[:brightbox].list_api_clients
- formats(Brightbox::Compute::Formats::Collection::API_CLIENTS) { result }
+ formats(Brightbox::Compute::Formats::Collection::API_CLIENTS, false) { result }
end
tests("#get_api_client('#{@api_client_id}')") do
pending if Fog.mocking?
result = Fog::Compute[:brightbox].get_api_client(@api_client_id)
- formats(Brightbox::Compute::Formats::Full::API_CLIENT) { result }
+ formats(Brightbox::Compute::Formats::Full::API_CLIENT, false) { result }
end
update_options = {:name => "Fog@#{Time.now.iso8601}"}
tests("#update_api_client('#{@api_client_id}', #{update_options.inspect})") do
pending if Fog.mocking?
result = Fog::Compute[:brightbox].update_api_client(@api_client_id, update_options)
- formats(Brightbox::Compute::Formats::Full::API_CLIENT) { result }
+ formats(Brightbox::Compute::Formats::Full::API_CLIENT, false) { result }
end
tests("#reset_secret_api_client('#{@api_client_id}')") do
pending if Fog.mocking?
result = Fog::Compute[:brightbox].reset_secret_api_client(@api_client_id)
- formats(Brightbox::Compute::Formats::Full::API_CLIENT) { result }
+ formats(Brightbox::Compute::Formats::Full::API_CLIENT, false) { result }
test("new secret is visible") { ! result["secret"].nil? }
end
tests("#destroy_api_client('#{@api_client_id}')") do
pending if Fog.mocking?
result = Fog::Compute[:brightbox].destroy_api_client(@api_client_id)
- formats(Brightbox::Compute::Formats::Full::API_CLIENT) { result }
+ formats(Brightbox::Compute::Formats::Full::API_CLIENT, false) { result }
end
end
@@ -10,19 +10,19 @@
pending if Fog.mocking?
result = Fog::Compute[:brightbox].create_cloud_ip
@cloud_ip_id = result["id"]
- formats(Brightbox::Compute::Formats::Full::CLOUD_IP) { result }
+ formats(Brightbox::Compute::Formats::Full::CLOUD_IP, false) { result }
end
tests("#list_cloud_ips") do
pending if Fog.mocking?
result = Fog::Compute[:brightbox].list_cloud_ips
- formats(Brightbox::Compute::Formats::Collection::CLOUD_IPS) { result }
+ formats(Brightbox::Compute::Formats::Collection::CLOUD_IPS, false) { result }
end
tests("#get_cloud_ip('#{@cloud_ip_id}')") do
pending if Fog.mocking?
result = Fog::Compute[:brightbox].get_cloud_ip(@cloud_ip_id)
- formats(Brightbox::Compute::Formats::Full::CLOUD_IP) { result }
+ formats(Brightbox::Compute::Formats::Full::CLOUD_IP, false) { result }
end
unless Fog.mocking?
@@ -32,7 +32,7 @@
tests("#map_cloud_ip('#{@cloud_ip_id}', #{map_options.inspect})") do
pending if Fog.mocking?
result = Fog::Compute[:brightbox].map_cloud_ip(@cloud_ip_id, map_options)
- formats(Brightbox::Compute::Formats::Full::CLOUD_IP) { result }
+ formats(Brightbox::Compute::Formats::Full::CLOUD_IP, false) { result }
end
unless Fog.mocking?
@@ -42,7 +42,7 @@
tests("#unmap_cloud_ip('#{@cloud_ip_id}')") do
pending if Fog.mocking?
result = Fog::Compute[:brightbox].unmap_cloud_ip(@cloud_ip_id)
- formats(Brightbox::Compute::Formats::Full::CLOUD_IP) { result }
+ formats(Brightbox::Compute::Formats::Full::CLOUD_IP, false) { result }
end
unless Fog.mocking?
@@ -52,14 +52,14 @@
tests("#update_cloud_ip('#{@cloud_ip_id}', #{update_options.inspect})") do
pending if Fog.mocking?
result = Fog::Compute[:brightbox].update_cloud_ip(@cloud_ip_id, update_options)
- formats(Brightbox::Compute::Formats::Full::CLOUD_IP) { result }
+ formats(Brightbox::Compute::Formats::Full::CLOUD_IP, false) { result }
result = Fog::Compute[:brightbox].update_cloud_ip(@cloud_ip_id, {:reverse_dns => ""})
end
tests("#destroy_cloud_ip('#{@cloud_ip_id}')") do
pending if Fog.mocking?
result = Fog::Compute[:brightbox].destroy_cloud_ip(@cloud_ip_id)
- formats(Brightbox::Compute::Formats::Full::CLOUD_IP) { result }
+ formats(Brightbox::Compute::Formats::Full::CLOUD_IP, false) { result }
end
unless Fog.mocking?
@@ -19,13 +19,13 @@
pending if Fog.mocking?
result = Fog::Compute[:brightbox].list_images
@image_id = result.first["id"]
- formats(Brightbox::Compute::Formats::Collection::IMAGES) { result }
+ formats(Brightbox::Compute::Formats::Collection::IMAGES, false) { result }
end
tests("#get_image('#{@image_id}')") do
pending if Fog.mocking?
result = Fog::Compute[:brightbox].get_image(@image_id)
- formats(Brightbox::Compute::Formats::Full::IMAGE) { result }
+ formats(Brightbox::Compute::Formats::Full::IMAGE, false) { result }
end
## Until Image creation can be automated, we shouldn't be updating Images randomly
@@ -10,7 +10,7 @@
tests("#get_interface('#{@interface_id}')") do
pending if Fog.mocking?
result = Fog::Compute[:brightbox].get_interface(@interface_id)
- formats(Brightbox::Compute::Formats::Full::INTERFACE) { result }
+ formats(Brightbox::Compute::Formats::Full::INTERFACE, false) { result }
end
end
@@ -26,7 +26,7 @@
pending if Fog.mocking?
result = Fog::Compute[:brightbox].create_load_balancer(create_options)
@load_balancer_id = result["id"]
- formats(Brightbox::Compute::Formats::Full::LOAD_BALANCER) { result }
+ formats(Brightbox::Compute::Formats::Full::LOAD_BALANCER, false) { result }
end
unless Fog.mocking?
@@ -36,34 +36,34 @@
tests("#list_load_balancers()") do
pending if Fog.mocking?
result = Fog::Compute[:brightbox].list_load_balancers
- formats(Brightbox::Compute::Formats::Collection::LOAD_BALANCERS) { result }
+ formats(Brightbox::Compute::Formats::Collection::LOAD_BALANCERS, false) { result }
end
tests("#get_load_balancer('#{@load_balancer_id}')") do
pending if Fog.mocking?
result = Fog::Compute[:brightbox].get_load_balancer(@load_balancer_id)
- formats(Brightbox::Compute::Formats::Full::LOAD_BALANCER) { result }
+ formats(Brightbox::Compute::Formats::Full::LOAD_BALANCER, false) { result }
end
update_options = {:name => "New name"}
tests("#update_load_balancer('#{@load_balancer_id}', #{update_options.inspect})") do
pending if Fog.mocking?
result = Fog::Compute[:brightbox].update_load_balancer(@load_balancer_id, update_options)
- formats(Brightbox::Compute::Formats::Full::LOAD_BALANCER) { result }
+ formats(Brightbox::Compute::Formats::Full::LOAD_BALANCER, false) { result }
end
add_listeners_options = {:listeners=>[{:out=>28080, :in=>8080, :protocol=>"http"}]}
tests("#add_listeners_load_balancer('#{@load_balancer_id}', #{add_listeners_options.inspect})") do
pending if Fog.mocking?
result = Fog::Compute[:brightbox].add_listeners_load_balancer(@load_balancer_id, add_listeners_options)
- formats(Brightbox::Compute::Formats::Full::LOAD_BALANCER) { result }
+ formats(Brightbox::Compute::Formats::Full::LOAD_BALANCER, false) { result }
end
remove_listeners_options = {:listeners=>[{:out=>28080, :in=>8080, :protocol=>"http"}]}
tests("#remove_listeners_load_balancer('#{@load_balancer_id}', #{remove_listeners_options.inspect})") do
pending if Fog.mocking?
result = Fog::Compute[:brightbox].remove_listeners_load_balancer(@load_balancer_id, remove_listeners_options)
- formats(Brightbox::Compute::Formats::Full::LOAD_BALANCER) { result }
+ formats(Brightbox::Compute::Formats::Full::LOAD_BALANCER, false) { result }
end
unless Fog.mocking?
@@ -76,21 +76,21 @@
tests("#add_nodes_load_balancer('#{@load_balancer_id}', #{add_nodes_options.inspect})") do
pending if Fog.mocking?
result = Fog::Compute[:brightbox].add_nodes_load_balancer(@load_balancer_id, add_nodes_options)
- formats(Brightbox::Compute::Formats::Full::LOAD_BALANCER) { result }
+ formats(Brightbox::Compute::Formats::Full::LOAD_BALANCER, false) { result }
end
# ...before we can attempt to remove either
remove_nodes_options = {:nodes => [{:node => node_id}]}
tests("#remove_nodes_load_balancer('#{@load_balancer_id}', #{remove_nodes_options.inspect})") do
pending if Fog.mocking?
result = Fog::Compute[:brightbox].remove_nodes_load_balancer(@load_balancer_id, remove_nodes_options)
- formats(Brightbox::Compute::Formats::Full::LOAD_BALANCER) { result }
+ formats(Brightbox::Compute::Formats::Full::LOAD_BALANCER, false) { result }
end
tests("#destroy_load_balancer('#{@load_balancer_id}')") do
pending if Fog.mocking?
result = Fog::Compute[:brightbox].destroy_load_balancer(@load_balancer_id)
- formats(Brightbox::Compute::Formats::Full::LOAD_BALANCER) { result }
+ formats(Brightbox::Compute::Formats::Full::LOAD_BALANCER, false) { result }
end
unless Fog.mocking?
@@ -18,55 +18,55 @@
pending if Fog.mocking?
result = Fog::Compute[:brightbox].create_server_group(create_options)
@server_group_id = result["id"]
- formats(Brightbox::Compute::Formats::Full::SERVER_GROUP) { result }
+ formats(Brightbox::Compute::Formats::Full::SERVER_GROUP, false) { result }
end
tests("#list_server_groups") do
pending if Fog.mocking?
result = Fog::Compute[:brightbox].list_server_groups
- formats(Brightbox::Compute::Formats::Collection::SERVER_GROUPS) { result }
+ formats(Brightbox::Compute::Formats::Collection::SERVER_GROUPS, false) { result }
@default_group_id = result.select {|grp| grp["default"] == true }.first["id"]
end
tests("#get_server_group('#{@server_group_id}')") do
pending if Fog.mocking?
result = Fog::Compute[:brightbox].get_server_group(@server_group_id)
- formats(Brightbox::Compute::Formats::Full::SERVER_GROUP) { result }
+ formats(Brightbox::Compute::Formats::Full::SERVER_GROUP, false) { result }
end
update_options = {:name => "Fog@#{Time.now.iso8601}"}
tests("#update_server_group('#{@server_group_id}', #{update_options.inspect})") do
pending if Fog.mocking?
result = Fog::Compute[:brightbox].update_server_group(@server_group_id, update_options)
- formats(Brightbox::Compute::Formats::Full::SERVER_GROUP) { result }
+ formats(Brightbox::Compute::Formats::Full::SERVER_GROUP, false) { result }
end
remove_options = {:servers => [{:server => server_id}]}
tests("#remove_servers_server_group('#{@server_group_id}', #{remove_options.inspect})") do
pending if Fog.mocking?
result = Fog::Compute[:brightbox].remove_servers_server_group(@server_group_id, remove_options)
- formats(Brightbox::Compute::Formats::Full::SERVER_GROUP) { result }
+ formats(Brightbox::Compute::Formats::Full::SERVER_GROUP, false) { result }
end
add_options = {:servers => [{:server => server_id}]}
tests("#add_servers_server_group('#{@server_group_id}', #{remove_options.inspect})") do
pending if Fog.mocking?
result = Fog::Compute[:brightbox].add_servers_server_group(@server_group_id, add_options)
- formats(Brightbox::Compute::Formats::Full::SERVER_GROUP) { result }
+ formats(Brightbox::Compute::Formats::Full::SERVER_GROUP, false) { result }
end
move_options = {:destination => @default_group_id, :servers => [{:server => server_id}]}
tests("#move_servers_server_group('#{@server_group_id}', #{move_options.inspect})") do
pending if Fog.mocking?
result = Fog::Compute[:brightbox].move_servers_server_group(@server_group_id, move_options)
- formats(Brightbox::Compute::Formats::Full::SERVER_GROUP) { result }
+ formats(Brightbox::Compute::Formats::Full::SERVER_GROUP, false) { result }
test("group is emptied") { result["servers"].empty? }
end
tests("#destroy_server_group('#{@server_group_id}')") do
pending if Fog.mocking?
result = Fog::Compute[:brightbox].destroy_server_group(@server_group_id)
- formats(Brightbox::Compute::Formats::Full::SERVER_GROUP) { result }
+ formats(Brightbox::Compute::Formats::Full::SERVER_GROUP, false) { result }
end
unless Fog.mocking?
@@ -11,7 +11,7 @@
pending if Fog.mocking?
result = Fog::Compute[:brightbox].create_server(:image => image_id)
server_id = result["id"]
- formats(Brightbox::Compute::Formats::Full::SERVER) { result }
+ formats(Brightbox::Compute::Formats::Full::SERVER, false) { result }
end
unless Fog.mocking?
@@ -21,49 +21,49 @@
tests("#list_servers") do
pending if Fog.mocking?
result = Fog::Compute[:brightbox].list_servers
- formats(Brightbox::Compute::Formats::Collection::SERVERS) { result }
+ formats(Brightbox::Compute::Formats::Collection::SERVERS, false) { 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) { result }
+ formats(Brightbox::Compute::Formats::Full::SERVER, false) { 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) { result }
+ formats(Brightbox::Compute::Formats::Full::SERVER, false) { 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) { result }
+ formats(Brightbox::Compute::Formats::Full::SERVER, false) { result }
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) { result }
+ formats(Brightbox::Compute::Formats::Full::SERVER, false) { 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) { result }
+ formats(Brightbox::Compute::Formats::Full::SERVER, false) { 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) { result }
+ formats(Brightbox::Compute::Formats::Full::SERVER, false) { 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) { result }
+ formats(Brightbox::Compute::Formats::Full::SERVER, false) { result }
snapshot_id = result["id"]
@snapshot = Fog::Compute[:brightbox].images.get(snapshot_id)
@snapshot.destroy
@@ -72,7 +72,7 @@
tests("#destroy_server('#{server_id}')") do
pending if Fog.mocking?
result = Fog::Compute[:brightbox].destroy_server(server_id)
- formats(Brightbox::Compute::Formats::Full::SERVER) { result }
+ formats(Brightbox::Compute::Formats::Full::SERVER, false) { result }
end
end
@@ -6,13 +6,13 @@
pending if Fog.mocking?
result = Fog::Compute[:brightbox].list_server_types
@server_type_id = result.first["id"]
- formats(Brightbox::Compute::Formats::Collection::SERVER_TYPES) { result }
+ formats(Brightbox::Compute::Formats::Collection::SERVER_TYPES, false) { result }
end
tests("#get_server_type('#{@server_type_id}')") do
pending if Fog.mocking?
result = Fog::Compute[:brightbox].get_server_type(@server_type_id)
- formats(Brightbox::Compute::Formats::Full::SERVER_TYPE) { result }
+ formats(Brightbox::Compute::Formats::Full::SERVER_TYPE, false) { result }
end
end
Oops, something went wrong.

0 comments on commit f8c4900

Please sign in to comment.