From d6b93f6602d86b9506ecb95604233269a5a7f9ea Mon Sep 17 00:00:00 2001 From: Rupak Ganguly Date: Fri, 6 Apr 2012 15:35:50 -0400 Subject: [PATCH] Add tests for key_pair model and key_pairs collection. --- tests/hp/models/compute/key_pair_tests.rb | 27 ++++++++++++++++++++++ tests/hp/models/compute/key_pairs_tests.rb | 5 ++++ 2 files changed, 32 insertions(+) create mode 100644 tests/hp/models/compute/key_pair_tests.rb create mode 100644 tests/hp/models/compute/key_pairs_tests.rb diff --git a/tests/hp/models/compute/key_pair_tests.rb b/tests/hp/models/compute/key_pair_tests.rb new file mode 100644 index 000000000..4b4c49fd3 --- /dev/null +++ b/tests/hp/models/compute/key_pair_tests.rb @@ -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 diff --git a/tests/hp/models/compute/key_pairs_tests.rb b/tests/hp/models/compute/key_pairs_tests.rb new file mode 100644 index 000000000..60e34ebfa --- /dev/null +++ b/tests/hp/models/compute/key_pairs_tests.rb @@ -0,0 +1,5 @@ +Shindo.tests("Fog::Compute[:hp] | key_pairs", ['hp']) do + + collection_tests(Fog::Compute[:hp].key_pairs, {:name => 'fogkeyname'}, true) + +end \ No newline at end of file