summaryrefslogtreecommitdiff
path: root/openstackclient/tests/identity/v3
diff options
context:
space:
mode:
Diffstat (limited to 'openstackclient/tests/identity/v3')
-rw-r--r--openstackclient/tests/identity/v3/fakes.py6
-rw-r--r--openstackclient/tests/identity/v3/test_token.py21
2 files changed, 27 insertions, 0 deletions
diff --git a/openstackclient/tests/identity/v3/fakes.py b/openstackclient/tests/identity/v3/fakes.py
index a06802c5..420604f1 100644
--- a/openstackclient/tests/identity/v3/fakes.py
+++ b/openstackclient/tests/identity/v3/fakes.py
@@ -244,6 +244,12 @@ TRUST = {
token_expires = '2014-01-01T00:00:00Z'
token_id = 'tttttttt-tttt-tttt-tttt-tttttttttttt'
+UNSCOPED_TOKEN = {
+ 'expires': token_expires,
+ 'id': token_id,
+ 'user_id': user_id,
+}
+
TOKEN_WITH_PROJECT_ID = {
'expires': token_expires,
'id': token_id,
diff --git a/openstackclient/tests/identity/v3/test_token.py b/openstackclient/tests/identity/v3/test_token.py
index b051aacb..80c397bc 100644
--- a/openstackclient/tests/identity/v3/test_token.py
+++ b/openstackclient/tests/identity/v3/test_token.py
@@ -85,6 +85,27 @@ class TestTokenIssue(TestToken):
)
self.assertEqual(datalist, data)
+ def test_token_issue_with_unscoped(self):
+ arglist = []
+ verifylist = []
+ parsed_args = self.check_parser(self.cmd, arglist, verifylist)
+ self.sc_mock.get_token.return_value = \
+ identity_fakes.UNSCOPED_TOKEN
+
+ # DisplayCommandBase.take_action() returns two tuples
+ columns, data = self.cmd.take_action(parsed_args)
+
+ self.sc_mock.get_token.assert_called_with()
+
+ collist = ('expires', 'id', 'user_id')
+ self.assertEqual(collist, columns)
+ datalist = (
+ identity_fakes.token_expires,
+ identity_fakes.token_id,
+ identity_fakes.user_id,
+ )
+ self.assertEqual(datalist, data)
+
class TestTokenRevoke(TestToken):