Skip to content

Commit

Permalink
Make coveralls even more happy
Browse files Browse the repository at this point in the history
  • Loading branch information
pyhedgehog committed Dec 22, 2016
1 parent 345b50e commit 74faf4d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/interface_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,9 @@ def test_ensure_token(self):
uri = self.path("/users/{}/tokens".format(self.username_password.username))
responses.add(responses.GET, uri, body="[]", status=200)
responses.add(responses.POST, uri, body=self.token_json_str, status=200)
responses.add(responses.GET, uri, body="["+self.token_json_str+"]", status=200)
token = self.client.ensure_token(self.username_password, self.expected_token.name, self.username_password.username)
self.assertEqual(token.token, self.expected_token.sha1)
token = self.client.ensure_token(self.username_password, self.expected_token.name, self.username_password.username)
self.assertEqual(token.token, self.expected_token.sha1)

Expand All @@ -258,6 +261,11 @@ def test_ensure_auth_token(self):
uri = self.path("/users/{}/tokens".format(self.expected_user.username))
responses.add(responses.GET, uri, body="[]", status=200)
responses.add(responses.POST, uri, body=self.token_json_str, status=200)
tokens = self.client.get_tokens(self.username_password)
self.assertEqual(tokens, [])
tokeninfo = self.client.create_token(self.username_password, self.expected_token.name)
self.assertEqual(tokeninfo.name, self.expected_token.name)
self.assertEqual(tokeninfo.sha1, self.expected_token.sha1)
token = self.client.ensure_token(self.username_password, self.expected_token.name)
self.assertEqual(token.token, self.expected_token.sha1)

Expand Down

0 comments on commit 74faf4d

Please sign in to comment.