Skip to content

Commit

Permalink
Merge pull request #2741 from brightbox/brightbox_updates
Browse files Browse the repository at this point in the history
Brightbox test updates
  • Loading branch information
tokengeek committed Mar 7, 2014
2 parents b76f85f + 3b2e933 commit 06e595c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
3 changes: 2 additions & 1 deletion tests/brightbox/requests/compute/account_tests.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,12 @@
tests("#get_account(#{@scoped_account_identifier}") do
pending if Fog.mocking?
result = Fog::Compute[:brightbox].get_account(@scoped_account_identifier)
@current_name = result["name"]
data_matches_schema(Brightbox::Compute::Formats::Full::ACCOUNT, {:allow_extra_keys => true}) { result }
test("ftp password is blanked") { result["library_ftp_password"].nil? }
end

update_options = {:name => "Fog@#{Time.now.iso8601}"}
update_options = { :name => @current_name }
tests("#update_scoped_account(#{update_options.inspect})") do
pending if Fog.mocking?
result = Fog::Compute[:brightbox].update_scoped_account(update_options)
Expand Down
10 changes: 5 additions & 5 deletions tests/brightbox/requests/compute/database_snapsnot_tests.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,18 @@
# Create a Database Server, then snapshot it
database_server = service.database_servers.create
database_server.wait_for { ready? }

result = service.snapshot_database_server(database_server.id)
database_server.destroy
service.snapshot_database_server(database_server.id)

tests("#list_database_snapshots") do
result = service.list_database_snapshots
data_matches_schema(Brightbox::Compute::Formats::Collection::DATABASE_SNAPSHOTS, {:allow_extra_keys => true}) { result }
@database_snapshot_id = result.last["id"]
end

# Can't delete the server until snapshot is finished
service.database_snapshots.get(@database_snapshot_id).wait_for { ready? }
database_server.destroy

tests("#get_database_snapshot('#{@database_snapshot_id}')") do
result = service.get_database_snapshot(@database_snapshot_id)
data_matches_schema(Brightbox::Compute::Formats::Full::DATABASE_SNAPSHOT, {:allow_extra_keys => true}) { result }
Expand All @@ -31,8 +33,6 @@
data_matches_schema(Brightbox::Compute::Formats::Full::DATABASE_SNAPSHOT, {:allow_extra_keys => true}) { result }
end

service.database_snapshots.get(@database_snapshot_id).wait_for { ready? }

tests("#destroy_database_snapshot('#{@database_snapshot_id}')") do
result = service.destroy_database_snapshot(@database_snapshot_id)
data_matches_schema(Brightbox::Compute::Formats::Full::DATABASE_SNAPSHOT, {:allow_extra_keys => true}) { result }
Expand Down
4 changes: 3 additions & 1 deletion tests/brightbox/requests/compute/user_tests.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@
tests("#get_user('#{@user_id}')") do
pending if Fog.mocking?
result = Fog::Compute[:brightbox].get_user(@user_id)
@current_name = result["name"]
data_matches_schema(Brightbox::Compute::Formats::Full::USER, {:allow_extra_keys => true}) { result }
end

update_options = { :name => "Example User" }
# Rather than setting the name to something useless we set it to the original value
update_options = { :name => @current_name }
tests("#update_user('#{@user_id}', #{update_options.inspect})") do
pending if Fog.mocking?
result = Fog::Compute[:brightbox].update_user(@user_id, update_options)
Expand Down

0 comments on commit 06e595c

Please sign in to comment.