From 3f92a97b5a16b0877cba815d8dff966da18792a4 Mon Sep 17 00:00:00 2001 From: David Stanek Date: Tue, 15 Nov 2016 20:03:47 +0000 Subject: [PATCH] Fixes remaining nits in endpoint_policy tests Original review: Idde4b139ef4d1b048901f5a0a1fd9df3b6836994 Change-Id: I487b91984a5579a61562f786e46345e20e017ab1 --- .../tests/unit/endpoint_policy/backends/test_base.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/keystone/tests/unit/endpoint_policy/backends/test_base.py b/keystone/tests/unit/endpoint_policy/backends/test_base.py index 8d00fb145d..279b3d7f59 100644 --- a/keystone/tests/unit/endpoint_policy/backends/test_base.py +++ b/keystone/tests/unit/endpoint_policy/backends/test_base.py @@ -44,11 +44,11 @@ class DriverTestCase(object): def test_recreate_policy_association(self): # Creating a policy association to a target that already has a policy - # associated to it, will cause the original policy to be overridden + # associated to it will cause the original policy to be overridden original_association = self.create_association( service_id=uuid.uuid4().hex) override_association = original_association.copy() - override_association.update({'policy_id': uuid.uuid4().hex}) + override_association['policy_id'] = uuid.uuid4().hex self.driver.create_policy_association(**override_association) @@ -94,10 +94,8 @@ class DriverTestCase(object): second = self.create_association(service_id=uuid.uuid4().hex, policy_id=policy_id) - associations_ref = self.driver.list_associations_for_policy(policy_id) - - self.assertIn(first, associations_ref) - self.assertIn(second, associations_ref) + associations = self.driver.list_associations_for_policy(policy_id) + self.assertItemsEqual([first, second], associations) def test_delete_association_by_endpoint(self): endpoint_id = uuid.uuid4().hex