2013-07-24 17:17:36 -04:00
|
|
|
Shindo.tests('Fog::Compute::RackspaceV2 | keypairs', ['rackspace']) do
|
|
|
|
service = Fog::Compute::RackspaceV2.new
|
|
|
|
|
|
|
|
name = Fog::Mock.random_letters(32)
|
|
|
|
|
|
|
|
tests("success") do
|
|
|
|
tests("#create").succeeds do
|
|
|
|
service.keypairs.create({:name => name})
|
|
|
|
end
|
|
|
|
|
|
|
|
tests("#all").succeeds do
|
|
|
|
service.keypairs.all
|
|
|
|
end
|
|
|
|
|
|
|
|
tests("#get").succeeds do
|
|
|
|
service.keypairs.get(name)
|
|
|
|
end
|
|
|
|
|
|
|
|
tests("#delete").succeeds do
|
|
|
|
service.keypairs.destroy(name)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
tests('failure') do
|
2013-07-25 16:58:05 -04:00
|
|
|
tests("unknown_get").raises(Fog::Compute::RackspaceV2::NotFound) do
|
2013-07-24 17:17:36 -04:00
|
|
|
service.keypairs.get(Fog::Mock.random_letters(32))
|
|
|
|
end
|
|
|
|
|
2013-07-25 16:58:05 -04:00
|
|
|
tests("unknown_delete").raises(Fog::Compute::RackspaceV2::NotFound) do
|
2013-07-25 01:45:22 -04:00
|
|
|
service.keypairs.destroy(Fog::Mock.random_letters(32))
|
2013-07-24 17:17:36 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|