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:
parent
cd8dc2b106
commit
d6b93f6602
2 changed files with 32 additions and 0 deletions
27
tests/hp/models/compute/key_pair_tests.rb
Normal file
27
tests/hp/models/compute/key_pair_tests.rb
Normal 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
|
5
tests/hp/models/compute/key_pairs_tests.rb
Normal file
5
tests/hp/models/compute/key_pairs_tests.rb
Normal 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
|
Loading…
Add table
Reference in a new issue