Skip to content

Commit

Permalink
[openstack|identity] add tests for check_token and validate_token par…
Browse files Browse the repository at this point in the history
…ameters

Fixes fog#3493
  • Loading branch information
dhague committed Mar 20, 2015
1 parent 413426c commit 65c745c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/fog/openstack/requests/identity/check_token.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ def check_token(token_id, tenant_id=nil)
end

class Mock
def check_token(token_id, tenant_id=nil)
end
end
end
end
Expand Down
2 changes: 2 additions & 0 deletions lib/fog/openstack/requests/identity/validate_token.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ def validate_token(token_id, tenant_id=nil)
end

class Mock
def validate_token(token_id, tenant_id=nil)
end
end
end
end
Expand Down
10 changes: 10 additions & 0 deletions tests/openstack/authenticate_tests.rb
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,16 @@
end
end

tests("validate token") do
Fog::Identity[:openstack].validate_token(token, tenant_token)
Fog::Identity[:openstack].validate_token(token)
end

tests("check token") do
Fog::Identity[:openstack].check_token(token, tenant_token)
Fog::Identity[:openstack].check_token(token)
end

tests("v2 missing service") do
Excon.stub({ :method => 'POST', :path => "/v2.0/tokens" },
{ :status => 200, :body => Fog::JSON.encode(body) })
Expand Down

0 comments on commit 65c745c

Please sign in to comment.