Debian Codegraph @

keystoneclient/tests/unit/v2_0/utils.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 from keystoneclient.tests.unit import client_fixtures
14 from keystoneclient.tests.unit import utils
15
16
17 class UnauthenticatedTestCase(utils.TestCase):
18 """Class used as base for unauthenticated calls."""
19
20 TEST_ROOT_URL = 'http://127.0.0.1:5000/'
21 TEST_URL = '%s%s' % (TEST_ROOT_URL, 'v2.0')
22 TEST_ROOT_ADMIN_URL = 'http://127.0.0.1:35357/'
23 TEST_ADMIN_URL = '%s%s' % (TEST_ROOT_ADMIN_URL, 'v2.0')
24
25
26 class TestCase(UnauthenticatedTestCase):
27
28 TEST_ADMIN_IDENTITY_ENDPOINT = "http://127.0.0.1:35357/v2.0"
29
30 TEST_SERVICE_CATALOG = [{
31 "endpoints": [{
32 "adminURL": "http://cdn.admin-nets.local:8774/v1.0",
33 "region": "RegionOne",
34 "internalURL": "http://127.0.0.1:8774/v1.0",
35 "publicURL": "http://cdn.admin-nets.local:8774/v1.0/"
36 }],
37 "type": "nova_compat",
38 "name": "nova_compat"
39 }, {
40 "endpoints": [{
41 "adminURL": "http://nova/novapi/admin",
42 "region": "RegionOne",
43 "internalURL": "http://nova/novapi/internal",
44 "publicURL": "http://nova/novapi/public"
45 }],
46 "type": "compute",
47 "name": "nova"
48 }, {
49 "endpoints": [{
50 "adminURL": "http://glance/glanceapi/admin",
51 "region": "RegionOne",
52 "internalURL": "http://glance/glanceapi/internal",
53 "publicURL": "http://glance/glanceapi/public"
54 }],
55 "type": "image",
56 "name": "glance"
57 }, {
58 "endpoints": [{
59 "adminURL": TEST_ADMIN_IDENTITY_ENDPOINT,
60 "region": "RegionOne",
61 "internalURL": "http://127.0.0.1:5000/v2.0",
62 "publicURL": "http://127.0.0.1:5000/v2.0"
63 }],
64 "type": "identity",
65 "name": "keystone"
66 }, {
67 "endpoints": [{
68 "adminURL": "http://swift/swiftapi/admin",
69 "region": "RegionOne",
70 "internalURL": "http://swift/swiftapi/internal",
71 "publicURL": "http://swift/swiftapi/public"
72 }],
73 "type": "object-store",
74 "name": "swift"
75 }]
76
77 def stub_auth(self, **kwargs):
78 self.stub_url('POST', ['tokens'], **kwargs)
79
80
81 class ClientTestCase(utils.ClientTestCaseMixin, TestCase):
82
83 scenarios = [
84 ('original',
85 {'client_fixture_class': client_fixtures.OriginalV2}),
86 ('ksc-session',
87 {'client_fixture_class': client_fixtures.KscSessionV2}),
88 ('ksa-session',
89 {'client_fixture_class': client_fixtures.KsaSessionV2}),
90 ]