deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfoj...@apache.org
Subject [2/2] git commit: Client: Fixed 'keys' unit tests
Date Fri, 11 Jan 2013 14:45:52 GMT
Updated Branches:
  refs/heads/master cf4ff1eda -> 46374925e


Client: Fixed 'keys' unit tests


Project: http://git-wip-us.apache.org/repos/asf/deltacloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltacloud/commit/7a6f2059
Tree: http://git-wip-us.apache.org/repos/asf/deltacloud/tree/7a6f2059
Diff: http://git-wip-us.apache.org/repos/asf/deltacloud/diff/7a6f2059

Branch: refs/heads/master
Commit: 7a6f2059108fe0449ca24e7e6e3baf9cb1179279
Parents: cf4ff1e
Author: Michal Fojtik <mfojtik@redhat.com>
Authored: Fri Jan 11 11:39:15 2013 +0100
Committer: Michal fojtik <mfojtik@redhat.com>
Committed: Fri Jan 11 15:45:31 2013 +0100

----------------------------------------------------------------------
 client/tests/keys_test.rb |   17 +++++------------
 1 files changed, 5 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltacloud/blob/7a6f2059/client/tests/keys_test.rb
----------------------------------------------------------------------
diff --git a/client/tests/keys_test.rb b/client/tests/keys_test.rb
index aa4d559..2610fd4 100644
--- a/client/tests/keys_test.rb
+++ b/client/tests/keys_test.rb
@@ -50,16 +50,18 @@ end
 
 describe "Operations on Keys" do
 
-  it "should allow successful creation of a new key" do
+  it "should allow successful creation and destroy of a new key" do
     DeltaCloud.new( API_NAME, API_PASSWORD, API_URL ) do |client|
       new_key = client.create_key({:name => "my_new_key"})
       check_key(new_key, "my_new_key")
+      the_key = client.key('my_new_key')
+      the_key.destroy!.must_be_nil
     end
   end
 
   it "should allow retrieval of an existing named key" do
     DeltaCloud.new( API_NAME, API_PASSWORD, API_URL ) do |client|
-      key_name = "my_new_key"
+      key_name = "test-key"
       create_key_if_necessary(client, key_name)
       the_key = client.key(key_name)
       check_key(the_key, key_name)
@@ -68,7 +70,7 @@ describe "Operations on Keys" do
 
   it "should raise error if you create a key with the same name as an existing key" do
     DeltaCloud.new( API_NAME, API_PASSWORD, API_URL ) do |client|
-      name = "my_new_key"
+      name = "test-key"
       create_key_if_necessary(client, name)
       lambda{
               client.create_key({:name => name})
@@ -76,13 +78,4 @@ describe "Operations on Keys" do
     end
   end
 
-  it "should allow successful destruction of an existing key" do
-    DeltaCloud.new( API_NAME, API_PASSWORD, API_URL ) do |client|
-      name = "my_new_key"
-      create_key_if_necessary(client, name)
-      the_key = client.key(name)
-      the_key.destroy!.must_be_nil
-    end
-  end
-
 end


Mime
View raw message