Ignoring order of user list in TenantTestCase

keystone.tests.test_v2_controller.TenantTestCase.
test_get_project_users_no_user should not bother asserting
the order of the results, only that the expected values appear in the list.
Replacing self.assertEqual(orig_project_users, new_project_users)
with self.assertEqual(sorted(orig_project_users), sorted(new_project_users))
Better option would be assertItemsEqual but its only available in 2.7 and later.

Closes-bug: #1332831
Change-Id: I09842e0375dc0fa8908241498e1cc794e04d992c
This commit is contained in:
Priti Desai 2014-06-21 17:34:45 +00:00
parent db0519dfa0
commit 7b339d1ff8
1 changed files with 3 additions and 1 deletions

View File

@ -58,7 +58,9 @@ class TenantTestCase(tests.TestCase):
_ADMIN_CONTEXT, project_id)
# The new user isn't included in the result, so no change.
self.assertEqual(orig_project_users, new_project_users)
# asserting that the expected values appear in the list,
# without asserting the order of the results
self.assertEqual(sorted(orig_project_users), sorted(new_project_users))
def test_list_projects_default_domain(self):
"""Test that list projects only returns those in the default domain."""