1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

[compute|brightbox] Updates to tests

* Added some missing requests to tests
* Stop reverting name changes from updates
  - not sure best way to limit tests to people who realise details will change
* General reorganisation
This commit is contained in:
Paul Thornthwaite 2011-08-23 12:05:05 +01:00
parent 386ee9f138
commit 1a499cc601
6 changed files with 21 additions and 22 deletions

View file

@ -7,18 +7,10 @@ Shindo.tests('Fog::Compute[:brightbox] | account requests', ['brightbox']) do
Fog::Compute[:brightbox].get_account Fog::Compute[:brightbox].get_account
end end
unless Fog.mocking? update_options = {:name => "Fog@#{Time.now.iso8601}"}
original_name = Fog::Compute[:brightbox].get_account["name"] tests("#update_account(#{update_options.inspect})").formats(Brightbox::Compute::Formats::Full::ACCOUNT) do
update_args = {:name => "New name from Fog test"}
end
tests("#update_account(#{update_args.inspect})").formats(Brightbox::Compute::Formats::Full::ACCOUNT) do
pending if Fog.mocking? pending if Fog.mocking?
Fog::Compute[:brightbox].update_account(update_args) Fog::Compute[:brightbox].update_account(update_options)
end
unless Fog.mocking?
Fog::Compute[:brightbox].update_account(:name => original_name)
end end
tests("#reset_ftp_password_account").formats(Brightbox::Compute::Formats::Full::ACCOUNT) do tests("#reset_ftp_password_account").formats(Brightbox::Compute::Formats::Full::ACCOUNT) do

View file

@ -2,7 +2,10 @@ Shindo.tests('Fog::Compute[:brightbox] | api client requests', ['brightbox']) do
tests('success') do tests('success') do
create_options = {:name => "Name from Fog test (#{Time.now.to_i})", :description => "Description from Fog test"} create_options = {
:name => "Fog@#{Time.now.iso8601}",
:description => "Description from Fog test"
}
tests("#create_api_client(#{create_options.inspect})").formats(Brightbox::Compute::Formats::Full::API_CLIENT) do tests("#create_api_client(#{create_options.inspect})").formats(Brightbox::Compute::Formats::Full::API_CLIENT) do
pending if Fog.mocking? pending if Fog.mocking?
@ -21,9 +24,10 @@ Shindo.tests('Fog::Compute[:brightbox] | api client requests', ['brightbox']) do
Fog::Compute[:brightbox].get_api_client(@api_client_id) Fog::Compute[:brightbox].get_api_client(@api_client_id)
end end
update_options = {:name => "Fog@#{Time.now.iso8601}"}
tests("#update_api_client('#{@api_client_id}')").formats(Brightbox::Compute::Formats::Full::API_CLIENT) do tests("#update_api_client('#{@api_client_id}')").formats(Brightbox::Compute::Formats::Full::API_CLIENT) do
pending if Fog.mocking? pending if Fog.mocking?
Fog::Compute[:brightbox].update_api_client(@api_client_id, :name => "New name from Fog test") Fog::Compute[:brightbox].update_api_client(@api_client_id, update_options)
end end
tests("#destroy_api_client('#{@api_client_id}')").formats(Brightbox::Compute::Formats::Full::API_CLIENT) do tests("#destroy_api_client('#{@api_client_id}')").formats(Brightbox::Compute::Formats::Full::API_CLIENT) do

View file

@ -199,7 +199,10 @@ class Brightbox
"name" => String, "name" => String,
"status" => String, "status" => String,
"created_at" => String, "created_at" => String,
"deleted_at" => Fog::Nullable::String "deleted_at" => Fog::Nullable::String,
"account" => Brightbox::Compute::Formats::Nested::ACCOUNT,
"nodes" => [Brightbox::Compute::Formats::Nested::SERVER],
"cloud_ips" => [Brightbox::Compute::Formats::Nested::CLOUD_IP]
} }
SERVER = { SERVER = {

View file

@ -7,7 +7,7 @@ Shindo.tests('Fog::Compute[:brightbox] | load balancer requests', ['brightbox'])
node_id = @node.id node_id = @node.id
end end
creation_args = { create_options = {
:nodes => [{ :nodes => [{
:node => node_id :node => node_id
}], }],
@ -22,9 +22,9 @@ Shindo.tests('Fog::Compute[:brightbox] | load balancer requests', ['brightbox'])
} }
} }
tests("#create_load_balancer(#{creation_args.inspect})").formats(Brightbox::Compute::Formats::Full::LOAD_BALANCER) do tests("#create_load_balancer(#{create_options.inspect})").formats(Brightbox::Compute::Formats::Full::LOAD_BALANCER) do
pending if Fog.mocking? pending if Fog.mocking?
data = Fog::Compute[:brightbox].create_load_balancer(creation_args) data = Fog::Compute[:brightbox].create_load_balancer(create_options)
@load_balancer_id = data["id"] @load_balancer_id = data["id"]
data data
end end
@ -33,9 +33,9 @@ Shindo.tests('Fog::Compute[:brightbox] | load balancer requests', ['brightbox'])
Fog::Compute[:brightbox].load_balancers.get(@load_balancer_id).wait_for { ready? } Fog::Compute[:brightbox].load_balancers.get(@load_balancer_id).wait_for { ready? }
end end
# tests("#list_load_balancers()").formats(Brightbox::Compute::Formats::Collection::LOAD_BALANCERS) do tests("#list_load_balancers()").formats(Brightbox::Compute::Formats::Collection::LOAD_BALANCERS) do
# Fog::Compute[:brightbox].list_load_balancers Fog::Compute[:brightbox].list_load_balancers
# end end
tests("#get_load_balancer('#{@load_balancer_id}')").formats(Brightbox::Compute::Formats::Full::LOAD_BALANCER) do tests("#get_load_balancer('#{@load_balancer_id}')").formats(Brightbox::Compute::Formats::Full::LOAD_BALANCER) do
pending if Fog.mocking? pending if Fog.mocking?

View file

@ -28,7 +28,7 @@ Shindo.tests('Fog::Compute[:brightbox] | server requests', ['brightbox']) do
tests("#update_server('#{server_id}')").formats(Brightbox::Compute::Formats::Full::SERVER) do tests("#update_server('#{server_id}')").formats(Brightbox::Compute::Formats::Full::SERVER) do
pending if Fog.mocking? pending if Fog.mocking?
Fog::Compute[:brightbox].update_server(server_id, :name => "New name from Fog test") Fog::Compute[:brightbox].update_server(server_id, :name => "Fog@#{Time.now.iso8601}")
end end
tests("#activate_console_server('#{server_id}')").formats(Brightbox::Compute::Formats::Full::SERVER) do tests("#activate_console_server('#{server_id}')").formats(Brightbox::Compute::Formats::Full::SERVER) do

View file

@ -16,7 +16,7 @@ Shindo.tests('Fog::Compute[:brightbox] | user requests', ['brightbox']) do
data data
end end
update_options = { :name => "New name from Fog" } update_options = { :name => "Fog@#{Time.now.iso8601}" }
tests("#update_user('#{@user_id}', #{update_options.inspect})").formats(Brightbox::Compute::Formats::Full::USER) do tests("#update_user('#{@user_id}', #{update_options.inspect})").formats(Brightbox::Compute::Formats::Full::USER) do
pending if Fog.mocking? pending if Fog.mocking?