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

[brightbox] Replace duplicate remove with move test

* Still leaves group empty to allow deletion
This commit is contained in:
Paul Thornthwaite 2011-09-30 17:52:13 +01:00
parent e7af149bb7
commit 0971fdc2cd

View file

@ -25,6 +25,7 @@ Shindo.tests('Fog::Compute[:brightbox] | server group requests', ['brightbox'])
pending if Fog.mocking? pending if Fog.mocking?
result = Fog::Compute[:brightbox].list_server_groups result = Fog::Compute[:brightbox].list_server_groups
formats(Brightbox::Compute::Formats::Collection::SERVER_GROUPS) { result } formats(Brightbox::Compute::Formats::Collection::SERVER_GROUPS) { result }
@default_group_id = result.select {|grp| grp["default"] == true }.first["id"]
end end
tests("#get_server_group('#{@server_group_id}')") do tests("#get_server_group('#{@server_group_id}')") do
@ -54,12 +55,12 @@ Shindo.tests('Fog::Compute[:brightbox] | server group requests', ['brightbox'])
formats(Brightbox::Compute::Formats::Full::SERVER_GROUP) { result } formats(Brightbox::Compute::Formats::Full::SERVER_GROUP) { result }
end end
# Server Group must be empty to delete so we need to remove it again move_options = {:destination => @default_group_id, :servers => [{:server => server_id}]}
remove_options = {:servers => [{:server => server_id}]} tests("#move_servers_server_group('#{@server_group_id}', #{move_options.inspect})") do
tests("#remove_servers_server_group('#{@server_group_id}', #{remove_options.inspect})") do
pending if Fog.mocking? pending if Fog.mocking?
result = Fog::Compute[:brightbox].remove_servers_server_group(@server_group_id, remove_options) 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) { result }
test("group is emptied") { result["servers"].empty? }
end end
tests("#destroy_server_group('#{@server_group_id}')") do tests("#destroy_server_group('#{@server_group_id}')") do