Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Client: Fixed 'keys' unit tests

  • Loading branch information...
commit 7a6f2059108fe0449ca24e7e6e3baf9cb1179279 1 parent cf4ff1e
@mfojtik mfojtik authored
Showing with 5 additions and 12 deletions.
  1. +5 −12 client/tests/keys_test.rb
View
17 client/tests/keys_test.rb
@@ -50,16 +50,18 @@ def create_key_if_necessary(client, key_name)
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 @@ def create_key_if_necessary(client, key_name)
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 @@ def create_key_if_necessary(client, key_name)
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
Please sign in to comment.
Something went wrong with that request. Please try again.