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

Add tests for key_pair model and key_pairs collection.

This commit is contained in:
Rupak Ganguly 2012-04-06 15:35:50 -04:00
parent cd8dc2b106
commit d6b93f6602
2 changed files with 32 additions and 0 deletions

View file

@ -0,0 +1,27 @@
Shindo.tests("Fog::Compute[:hp] | key_pair", ['hp']) do
model_tests(Fog::Compute[:hp].key_pairs, {:name => 'fogkeyname'}, true)
after do
@keypair.destroy
end
tests("new keypair") do
@keypair = Fog::Compute[:hp].key_pairs.create(:name => 'testkey')
test ("writable?") do
@keypair.writable? == true
end
end
tests("existing keypair") do
Fog::Compute[:hp].key_pairs.create(:name => 'testkey')
@keypair = Fog::Compute[:hp].key_pairs.get('testkey')
test("writable?") do
@keypair.writable? == false
end
end
end

View file

@ -0,0 +1,5 @@
Shindo.tests("Fog::Compute[:hp] | key_pairs", ['hp']) do
collection_tests(Fog::Compute[:hp].key_pairs, {:name => 'fogkeyname'}, true)
end