From f2392bae79af18b6def0a47c8d7ded777323c8db Mon Sep 17 00:00:00 2001 From: shenxindi Date: Tue, 21 Jul 2020 10:27:39 +0800 Subject: [PATCH] Use assertCountEqual instead of assertItemsEqual The assertItemsEqual method has been removed in Python 3.3 [1] but it was kept alive by unittest2, imported by testtools. For better compatibility, change to assertCountEqual. [1] https://bugs.python.org/issue17866 Change-Id: Ib025191bdc2762a9f920dd6c83e427d75d9a8d01 --- mistral/tests/unit/api/v2/test_services.py | 2 +- mistral/tests/unit/test_coordination.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mistral/tests/unit/api/v2/test_services.py b/mistral/tests/unit/api/v2/test_services.py index bdc255a25..0e6c9d798 100644 --- a/mistral/tests/unit/api/v2/test_services.py +++ b/mistral/tests/unit/api/v2/test_services.py @@ -39,7 +39,7 @@ class TestServicesController(base.APITest): self.assertEqual(1, len(resp.json['services'])) srv_ret = [{"name": "service1", "type": "api_group"}] - self.assertItemsEqual(srv_ret, resp.json['services']) + self.assertCountEqual(srv_ret, resp.json['services']) def test_get_all_without_backend(self): cfg.CONF.set_default('backend_url', None, 'coordination') diff --git a/mistral/tests/unit/test_coordination.py b/mistral/tests/unit/test_coordination.py index 0b1e1c9a1..c4a607125 100644 --- a/mistral/tests/unit/test_coordination.py +++ b/mistral/tests/unit/test_coordination.py @@ -93,7 +93,7 @@ class ServiceCoordinatorTest(base.BaseTest): members = coordinator.get_members('fake_group') self.assertEqual(1, len(members)) - self.assertItemsEqual((six.b('fake_id'),), members) + self.assertCountEqual((six.b('fake_id'),), members) def test_join_group_and_leave_group(self): cfg.CONF.set_default(