diff options
author | Ruan HE <ruan.he@orange.com> | 2015-09-07 12:34:45 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@172.30.200.206> | 2015-09-07 12:34:45 +0000 |
commit | 312b1702ee332a2b8d71d88f849b55d8242fe45b (patch) | |
tree | 8ad8a1034815dfd3aacac61204bdf4eb13d2c132 /keystone-moon/keystone/tests | |
parent | 096f4359ce40e68e89be0c569ca78c0a8aaac65f (diff) | |
parent | fe16e5727e3efc8c096e79bcb181d04a4ac8416c (diff) |
Merge "End of Keystone code update to branch Master and fix some bugs."
Diffstat (limited to 'keystone-moon/keystone/tests')
-rw-r--r-- | keystone-moon/keystone/tests/moon/unit/__init__.py | 2 | ||||
-rw-r--r-- | keystone-moon/keystone/tests/moon/unit/test_unit_core_tenant.py | 21 |
2 files changed, 14 insertions, 9 deletions
diff --git a/keystone-moon/keystone/tests/moon/unit/__init__.py b/keystone-moon/keystone/tests/moon/unit/__init__.py index 54c9252e..149585cd 100644 --- a/keystone-moon/keystone/tests/moon/unit/__init__.py +++ b/keystone-moon/keystone/tests/moon/unit/__init__.py @@ -72,7 +72,7 @@ def create_mapping(self, tenant_name=None, authz_id=None, admin_id=None): "domain_id": "default" } keystone_tenant = self.resource_api.create_project(tenant["id"], tenant) - mapping = self.tenant_api.add_tenant_dict(self.root_api.get_root_admin_id(), tenant) + mapping = self.tenant_api.add_tenant_dict(self.root_api.get_root_admin_id(), tenant["id"], tenant) self.assertIsInstance(mapping, dict) self.assertIn("intra_authz_extension_id", mapping[tenant["id"]]) self.assertIn("intra_admin_extension_id", mapping[tenant["id"]]) diff --git a/keystone-moon/keystone/tests/moon/unit/test_unit_core_tenant.py b/keystone-moon/keystone/tests/moon/unit/test_unit_core_tenant.py index 3c136ccd..bf0fab08 100644 --- a/keystone-moon/keystone/tests/moon/unit/test_unit_core_tenant.py +++ b/keystone-moon/keystone/tests/moon/unit/test_unit_core_tenant.py @@ -78,7 +78,7 @@ class TestTenantManager(tests.TestCase): "intra_authz_extension_id": authz_intra_extension['id'], "intra_admin_extension_id": admin_intra_extension['id'], } - data = self.tenant_manager.add_tenant_dict(user_id=self.ADMIN_ID, tenant_dict=new_tenant) + data = self.tenant_manager.add_tenant_dict(user_id=self.ADMIN_ID, tenant_id=new_tenant['id'], tenant_dict=new_tenant) data_id = data.keys()[0] self.assertEquals(new_tenant["id"], data_id) self.assertEquals(new_tenant["name"], data[data_id]["name"]) @@ -97,12 +97,13 @@ class TestTenantManager(tests.TestCase): authz_intra_extension = create_intra_extension(self, policy_model="policy_authz") admin_intra_extension = create_intra_extension(self, policy_model="policy_admin") new_tenant = { + "id": uuid.uuid4().hex, "name": "demo", "description": uuid.uuid4().hex, "intra_authz_extension_id": authz_intra_extension['id'], "intra_admin_extension_id": admin_intra_extension['id'], } - data = self.tenant_manager.add_tenant_dict(user_id=self.ADMIN_ID, tenant_dict=new_tenant) + data = self.tenant_manager.add_tenant_dict(user_id=self.ADMIN_ID, tenant_id=new_tenant['id'], tenant_dict=new_tenant) data_id = data.keys()[0] self.assertEquals(new_tenant["name"], data[data_id]["name"]) self.assertEquals(new_tenant["intra_authz_extension_id"], data[data_id]["intra_authz_extension_id"]) @@ -117,12 +118,13 @@ class TestTenantManager(tests.TestCase): authz_intra_extension = create_intra_extension(self, policy_model="policy_authz") admin_intra_extension = create_intra_extension(self, policy_model="policy_admin") new_tenant = { + "id": uuid.uuid4().hex, "name": "demo", "description": uuid.uuid4().hex, "intra_authz_extension_id": authz_intra_extension['id'], "intra_admin_extension_id": admin_intra_extension['id'], } - data = self.tenant_manager.add_tenant_dict(user_id=self.ADMIN_ID, tenant_dict=new_tenant) + data = self.tenant_manager.add_tenant_dict(user_id=self.ADMIN_ID, tenant_id=new_tenant['id'], tenant_dict=new_tenant) data_id = data.keys()[0] self.assertEquals(new_tenant["name"], data[data_id]["name"]) self.assertEquals(new_tenant["intra_authz_extension_id"], data[data_id]["intra_authz_extension_id"]) @@ -146,12 +148,13 @@ class TestTenantManager(tests.TestCase): authz_intra_extension = create_intra_extension(self, policy_model="policy_authz") admin_intra_extension = create_intra_extension(self, policy_model="policy_admin") new_tenant = { + "id": uuid.uuid4().hex, "name": "demo", "description": uuid.uuid4().hex, "intra_authz_extension_id": authz_intra_extension['id'], "intra_admin_extension_id": admin_intra_extension['id'], } - data = self.tenant_manager.add_tenant_dict(user_id=self.ADMIN_ID, tenant_dict=new_tenant) + data = self.tenant_manager.add_tenant_dict(user_id=self.ADMIN_ID, tenant_id=new_tenant['id'], tenant_dict=new_tenant) data_id = data.keys()[0] self.assertEquals(new_tenant["name"], data[data_id]["name"]) self.assertEquals(new_tenant["intra_authz_extension_id"], data[data_id]["intra_authz_extension_id"]) @@ -165,12 +168,13 @@ class TestTenantManager(tests.TestCase): authz_intra_extension = create_intra_extension(self, policy_model="policy_authz") admin_intra_extension = create_intra_extension(self, policy_model="policy_admin") new_tenant = { + "id": uuid.uuid4().hex, "name": "demo", "description": uuid.uuid4().hex, "intra_authz_extension_id": authz_intra_extension['id'], "intra_admin_extension_id": admin_intra_extension['id'], } - data = self.tenant_manager.add_tenant_dict(user_id=self.ADMIN_ID, tenant_dict=new_tenant) + data = self.tenant_manager.add_tenant_dict(user_id=self.ADMIN_ID, tenant_id=new_tenant['id'], tenant_dict=new_tenant) data_id = data.keys()[0] self.assertEquals(new_tenant["name"], data[data_id]["name"]) self.assertEquals(new_tenant["intra_authz_extension_id"], data[data_id]["intra_authz_extension_id"]) @@ -178,21 +182,22 @@ class TestTenantManager(tests.TestCase): data = self.tenant_manager.get_tenants_dict(self.ADMIN_ID) self.assertNotEqual(data, {}) - self.assertRaises(TenantAddedNameExisting, self.tenant_manager.add_tenant_dict, self.ADMIN_ID, new_tenant) + self.assertRaises(TenantAddedNameExisting, self.tenant_manager.add_tenant_dict, self.ADMIN_ID, new_tenant['id'], new_tenant) def test_exception_tenant_no_intra_extension(self): authz_intra_extension = create_intra_extension(self, policy_model="policy_authz") admin_intra_extension = create_intra_extension(self, policy_model="policy_admin") new_tenant = { + "id": uuid.uuid4().hex, "name": "demo", "description": uuid.uuid4().hex, "intra_authz_extension_id": authz_intra_extension['id'], "intra_admin_extension_id": admin_intra_extension['id'], } new_tenant['intra_authz_extension_id'] = None - self.assertRaises(TenantNoIntraAuthzExtension, self.tenant_manager.add_tenant_dict, self.ADMIN_ID, new_tenant) + self.assertRaises(TenantNoIntraAuthzExtension, self.tenant_manager.add_tenant_dict, self.ADMIN_ID, new_tenant['id'], new_tenant) new_tenant['intra_authz_extension_id'] = authz_intra_extension['id'] - data = self.tenant_manager.add_tenant_dict(user_id=self.ADMIN_ID, tenant_dict=new_tenant) + data = self.tenant_manager.add_tenant_dict(user_id=self.ADMIN_ID, tenant_id=new_tenant['id'], tenant_dict=new_tenant) data_id = data.keys()[0] self.assertEquals(new_tenant["name"], data[data_id]["name"]) self.assertEquals(new_tenant["intra_authz_extension_id"], data[data_id]["intra_authz_extension_id"]) |