diff --git a/neutron/tests/unit/test_db_plugin.py b/neutron/tests/unit/test_db_plugin.py index d004fb359a..16c904b2e8 100644 --- a/neutron/tests/unit/test_db_plugin.py +++ b/neutron/tests/unit/test_db_plugin.py @@ -582,8 +582,7 @@ class NeutronDbPluginV2TestCase(testlib_api.WebTestCase): resource = resource.replace('-', '_') resources = resources.replace('-', '_') expected_res = [item[resource]['id'] for item in items] - self.assertEqual(sorted([n['id'] for n in res[resources]]), - sorted(expected_res)) + self.assertEqual(expected_res, [n['id'] for n in res[resources]]) def _test_list_with_pagination(self, resource, items, sort, limit, expected_page_num, @@ -616,10 +615,9 @@ class NeutronDbPluginV2TestCase(testlib_api.WebTestCase): '', content_type) self.assertEqual(len(res[resources]), limit) - self.assertEqual(page_num, expected_page_num) - self.assertEqual(sorted([n[verify_key] for n in items_res]), - sorted([item[resource][verify_key] - for item in items])) + self.assertEqual(expected_page_num, page_num) + self.assertEqual([item[resource][verify_key] for item in items], + [n[verify_key] for n in items_res]) def _test_list_with_pagination_reverse(self, resource, items, sort, limit, expected_page_num, @@ -655,11 +653,10 @@ class NeutronDbPluginV2TestCase(testlib_api.WebTestCase): '', content_type) self.assertEqual(len(res[resources]), limit) - self.assertEqual(page_num, expected_page_num) + self.assertEqual(expected_page_num, page_num) expected_res = [item[resource]['id'] for item in items] expected_res.reverse() - self.assertEqual(sorted([n['id'] for n in item_res]), - sorted(expected_res)) + self.assertEqual(expected_res, [n['id'] for n in item_res]) class TestBasicGet(NeutronDbPluginV2TestCase): diff --git a/neutron/tests/unit/vmware/vshield/test_lbaas_plugin.py b/neutron/tests/unit/vmware/vshield/test_lbaas_plugin.py index bd9fe937f1..978e159652 100644 --- a/neutron/tests/unit/vmware/vshield/test_lbaas_plugin.py +++ b/neutron/tests/unit/vmware/vshield/test_lbaas_plugin.py @@ -361,7 +361,7 @@ class TestLoadbalancerPlugin( ) as (vip1, vip2, vip3): self._test_list_with_sort( 'vip', - (vip1, vip3, vip2), + (vip1, vip2, vip3), [('protocol_port', 'asc'), ('name', 'desc')] ) req = self.new_list_request('vips')