diff options
author | Ruan HE <ruan.he@orange.com> | 2016-06-09 08:12:34 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@172.30.200.206> | 2016-06-09 08:12:34 +0000 |
commit | 4bc079a2664f9a407e332291f34d174625a9d5ea (patch) | |
tree | 7481cd5d0a9b3ce37c44c797a1e0d39881221cbe /keystone-moon/keystone/tests/unit/test_backend_endpoint_policy.py | |
parent | 2f179c5790fbbf6144205d3c6e5089e6eb5f048a (diff) | |
parent | 2e7b4f2027a1147ca28301e4f88adf8274b39a1f (diff) |
Merge "Update Keystone core to Mitaka."
Diffstat (limited to 'keystone-moon/keystone/tests/unit/test_backend_endpoint_policy.py')
-rw-r--r-- | keystone-moon/keystone/tests/unit/test_backend_endpoint_policy.py | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/keystone-moon/keystone/tests/unit/test_backend_endpoint_policy.py b/keystone-moon/keystone/tests/unit/test_backend_endpoint_policy.py index 6c2181aa..f72cad63 100644 --- a/keystone-moon/keystone/tests/unit/test_backend_endpoint_policy.py +++ b/keystone-moon/keystone/tests/unit/test_backend_endpoint_policy.py @@ -18,6 +18,7 @@ from six.moves import range from testtools import matchers from keystone import exception +from keystone.tests import unit class PolicyAssociationTests(object): @@ -51,11 +52,11 @@ class PolicyAssociationTests(object): 5 - region 2, Service 0 """ - def new_endpoint(region_id, service_id): - endpoint = {'id': uuid.uuid4().hex, 'interface': 'test', - 'region_id': region_id, 'service_id': service_id, - 'url': '/url'} + endpoint = unit.new_endpoint_ref(interface='test', + region_id=region_id, + service_id=service_id, + url='/url') self.endpoint.append(self.catalog_api.create_endpoint( endpoint['id'], endpoint)) @@ -63,18 +64,18 @@ class PolicyAssociationTests(object): self.endpoint = [] self.service = [] self.region = [] + + parent_region_id = None for i in range(3): - policy = {'id': uuid.uuid4().hex, 'type': uuid.uuid4().hex, - 'blob': {'data': uuid.uuid4().hex}} + policy = unit.new_policy_ref() self.policy.append(self.policy_api.create_policy(policy['id'], policy)) - service = {'id': uuid.uuid4().hex, 'type': uuid.uuid4().hex} + service = unit.new_service_ref() self.service.append(self.catalog_api.create_service(service['id'], service)) - region = {'id': uuid.uuid4().hex, 'description': uuid.uuid4().hex} - # Link the 3 regions together as a hierarchy, [0] at the top - if i != 0: - region['parent_region_id'] = self.region[i - 1]['id'] + region = unit.new_region_ref(parent_region_id=parent_region_id) + # Link the regions together as a hierarchy, [0] at the top + parent_region_id = region['id'] self.region.append(self.catalog_api.create_region(region)) new_endpoint(self.region[0]['id'], self.service[0]['id']) |