Debian Codegraph @

keystoneclient/tests/unit/auth/test_token.py

raw symbols SCIP
1 # Licensed under the Apache License, Version 2.0 (the "License"); you may
2 # not use this file except in compliance with the License. You may obtain
3 # a copy of the License at
4 #
5 # http://www.apache.org/licenses/LICENSE-2.0
6 #
7 # Unless required by applicable law or agreed to in writing, software
8 # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9 # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
10 # License for the specific language governing permissions and limitations
11 # under the License.
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)