From fe16e5727e3efc8c096e79bcb181d04a4ac8416c Mon Sep 17 00:00:00 2001 From: asteroide Date: Fri, 4 Sep 2015 17:14:14 +0200 Subject: End of Keystone code update to branch Master and fix some bugs. Change-Id: Iad3c4f0e6fc78532b92761aa46f2d8508f46a7da --- keystone-moon/keystone/tests/moon/unit/__init__.py | 2 +- .../tests/moon/unit/test_unit_core_tenant.py | 21 +++++++++++++-------- 2 files changed, 14 insertions(+), 9 deletions(-) (limited to 'keystone-moon/keystone/tests') 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"]) -- cgit 1.2.3-korg