| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
import uuid |
| 14 |
|
| 15 |
from keystoneclient.auth.identity.generic import token |
| 16 |
from keystoneclient.auth.identity import v2 |
| 17 |
from keystoneclient.auth.identity import v3 |
| 18 |
from keystoneclient.auth.identity.v3 import token as v3_token |
| 19 |
from keystoneclient.tests.unit.auth import utils |
| 20 |
|
| 21 |
|
| 22 |
class TokenTests(utils.GenericPluginTestCase): |
| 23 |
|
| 24 |
PLUGIN_CLASS = token.Token |
| 25 |
V2_PLUGIN_CLASS = v2.Token |
| 26 |
V3_PLUGIN_CLASS = v3.Token |
| 27 |
|
| 28 |
def new_plugin(self, **kwargs): |
| 29 |
kwargs.setdefault('token', uuid.uuid4().hex) |
| 30 |
return super(TokenTests, self).new_plugin(**kwargs) |
| 31 |
|
| 32 |
def test_options(self): |
| 33 |
opts = [o.name for o in self.PLUGIN_CLASS.get_options()] |
| 34 |
|
| 35 |
allowed_opts = ['token', |
| 36 |
'domain-id', |
| 37 |
'domain-name', |
| 38 |
'tenant-id', |
| 39 |
'tenant-name', |
| 40 |
'project-id', |
| 41 |
'project-name', |
| 42 |
'project-domain-id', |
| 43 |
'project-domain-name', |
| 44 |
'trust-id', |
| 45 |
'auth-url'] |
| 46 |
|
| 47 |
self.assertEqual(set(allowed_opts), set(opts)) |
| 48 |
self.assertEqual(len(allowed_opts), len(opts)) |
| 49 |
|
| 50 |
def test_symbols(self): |
| 51 |
self.assertIs(v3.Token, v3_token.Token) |
| 52 |
self.assertIs(v3.TokenMethod, v3_token.TokenMethod) |