2011-06-16 19:28:54 -04:00
|
|
|
Shindo.tests('Fog::Compute[:brightbox] | account requests', ['brightbox']) do
|
2010-12-06 09:50:59 -05:00
|
|
|
|
|
|
|
tests('success') do
|
|
|
|
|
2012-04-25 07:57:15 -04:00
|
|
|
tests("#list_accounts") do
|
|
|
|
pending if Fog.mocking?
|
|
|
|
result = Fog::Compute[:brightbox].list_accounts
|
|
|
|
formats(Brightbox::Compute::Formats::Collection::ACCOUNTS, false) { result }
|
|
|
|
end
|
|
|
|
|
2012-11-02 06:31:27 -04:00
|
|
|
tests("#get_scoped_account") do
|
2010-12-17 19:49:22 -05:00
|
|
|
pending if Fog.mocking?
|
2012-11-02 06:31:27 -04:00
|
|
|
result = Fog::Compute[:brightbox].get_scoped_account
|
|
|
|
@scoped_account_identifier = result["id"]
|
|
|
|
formats(Brightbox::Compute::Formats::Full::ACCOUNT, false) { result }
|
|
|
|
test("ftp password is blanked") { result["library_ftp_password"].nil? }
|
|
|
|
end
|
|
|
|
|
|
|
|
tests("#get_account(#{@scoped_account_identifier}") do
|
|
|
|
pending if Fog.mocking?
|
|
|
|
result = Fog::Compute[:brightbox].get_account(@scoped_account_identifier)
|
2012-02-06 05:49:18 -05:00
|
|
|
formats(Brightbox::Compute::Formats::Full::ACCOUNT, false) { result }
|
2011-09-29 05:15:03 -04:00
|
|
|
test("ftp password is blanked") { result["library_ftp_password"].nil? }
|
2010-12-17 19:49:22 -05:00
|
|
|
end
|
|
|
|
|
2011-08-23 07:05:05 -04:00
|
|
|
update_options = {:name => "Fog@#{Time.now.iso8601}"}
|
2012-11-02 14:52:07 -04:00
|
|
|
tests("#update_scoped_account(#{update_options.inspect})") do
|
2010-12-17 19:49:22 -05:00
|
|
|
pending if Fog.mocking?
|
2012-11-02 14:52:07 -04:00
|
|
|
result = Fog::Compute[:brightbox].update_scoped_account(update_options)
|
|
|
|
formats(Brightbox::Compute::Formats::Full::ACCOUNT, false) { result }
|
|
|
|
end
|
|
|
|
|
|
|
|
tests("#update_account(#{@scoped_account_identifier}, #{update_options.inspect})") do
|
|
|
|
pending if Fog.mocking?
|
|
|
|
result = Fog::Compute[:brightbox].update_account(@scoped_account_identifier, update_options)
|
2012-02-06 05:49:18 -05:00
|
|
|
formats(Brightbox::Compute::Formats::Full::ACCOUNT, false) { result }
|
2010-12-17 19:49:22 -05:00
|
|
|
end
|
|
|
|
|
2012-11-20 04:59:49 -05:00
|
|
|
tests("#reset_ftp_password_scoped_account") do
|
2010-12-17 19:49:22 -05:00
|
|
|
pending if Fog.mocking?
|
2012-11-20 04:59:49 -05:00
|
|
|
result = Fog::Compute[:brightbox].reset_ftp_password_scoped_account
|
|
|
|
formats(Brightbox::Compute::Formats::Full::ACCOUNT, false) { result }
|
|
|
|
test("new ftp password is visible") { ! result["library_ftp_password"].nil? }
|
|
|
|
end
|
|
|
|
|
|
|
|
tests("#reset_ftp_password_account(#{@scoped_account_identifier})") do
|
|
|
|
pending if Fog.mocking?
|
|
|
|
result = Fog::Compute[:brightbox].reset_ftp_password_account(@scoped_account_identifier)
|
2012-02-06 05:49:18 -05:00
|
|
|
formats(Brightbox::Compute::Formats::Full::ACCOUNT, false) { result }
|
2011-09-29 05:15:03 -04:00
|
|
|
test("new ftp password is visible") { ! result["library_ftp_password"].nil? }
|
2010-12-06 09:50:59 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
tests('failure') do
|
|
|
|
|
2011-08-16 12:12:39 -04:00
|
|
|
tests("#update_account").raises(ArgumentError) do
|
2010-12-17 19:49:22 -05:00
|
|
|
pending if Fog.mocking?
|
2011-06-16 19:28:54 -04:00
|
|
|
Fog::Compute[:brightbox].update_account
|
2010-12-06 09:50:59 -05:00
|
|
|
end
|
2010-12-17 19:49:22 -05:00
|
|
|
|
2010-12-06 09:50:59 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|