diff options
| author | Dirk Mueller <dirk@dmllr.de> | 2021-05-03 22:07:39 +0200 |
|---|---|---|
| committer | Javier Peña <jpena@redhat.com> | 2021-08-24 09:21:45 +0000 |
| commit | 53f1efa010f9319ef939109d2ed5c4a852271d74 (patch) | |
| tree | 29867b117854109a2fb60a0d8289b54bdbd29933 /openstackclient/tests/unit/identity/v2_0 | |
| parent | d50045e484df8f9662712bf1c2af3ec9bd3b2a2a (diff) | |
| download | python-openstackclient-wallaby-em.tar.gz | |
Replace assertItemsEqual with assertCountEqualwallaby-em5.5.1
assertItemsEqual was removed from Python's unittest.TestCase in
Python 3.3 [1][2]. We have been able to use them since then, because
testtools required unittest2, which still included it. With testtools
removing Python 2.7 support [3][4], we will lose support for
assertItemsEqual, so we should switch to use assertCountEqual.
[1] - https://bugs.python.org/issue17866
[2] - https://hg.python.org/cpython/rev/d9921cb6e3cd
[3] - testing-cabal/testtools#286
[4] - testing-cabal/testtools#277
Conflicts:
openstackclient/tests/unit/volume/v2/test_volume_snapshot.py
NOTE(jpena): This file is not present in stable/wallaby
Change-Id: I0bbffbec8889b8b3067cfe17d258f5cb16624f38
(cherry picked from commit e82a05864f482acc485d1bd35a4db23452f8b2ac)
Diffstat (limited to 'openstackclient/tests/unit/identity/v2_0')
3 files changed, 8 insertions, 8 deletions
diff --git a/openstackclient/tests/unit/identity/v2_0/test_catalog.py b/openstackclient/tests/unit/identity/v2_0/test_catalog.py index e2c56ba1..bfb28f69 100644 --- a/openstackclient/tests/unit/identity/v2_0/test_catalog.py +++ b/openstackclient/tests/unit/identity/v2_0/test_catalog.py @@ -74,7 +74,7 @@ class TestCatalogList(TestCatalog): catalog.EndpointsColumn( auth_ref.service_catalog.catalog[0]['endpoints']), ), ) - self.assertItemsEqual(datalist, tuple(data)) + self.assertCountEqual(datalist, tuple(data)) def test_catalog_list_with_endpoint_url(self): attr = { @@ -117,7 +117,7 @@ class TestCatalogList(TestCatalog): catalog.EndpointsColumn( auth_ref.service_catalog.catalog[0]['endpoints']), ), ) - self.assertItemsEqual(datalist, tuple(data)) + self.assertCountEqual(datalist, tuple(data)) class TestCatalogShow(TestCatalog): @@ -158,7 +158,7 @@ class TestCatalogShow(TestCatalog): 'supernova', 'compute', ) - self.assertItemsEqual(datalist, data) + self.assertCountEqual(datalist, data) class TestFormatColumns(TestCatalog): diff --git a/openstackclient/tests/unit/identity/v2_0/test_project.py b/openstackclient/tests/unit/identity/v2_0/test_project.py index 766d5dab..496214aa 100644 --- a/openstackclient/tests/unit/identity/v2_0/test_project.py +++ b/openstackclient/tests/unit/identity/v2_0/test_project.py @@ -643,7 +643,7 @@ class TestProjectShow(TestProject): self.fake_proj_show.name, format_columns.DictColumn({}), ) - self.assertItemsEqual(datalist, data) + self.assertCountEqual(datalist, data) class TestProjectUnset(TestProject): diff --git a/openstackclient/tests/unit/identity/v2_0/test_user.py b/openstackclient/tests/unit/identity/v2_0/test_user.py index dd300478..c3f5f1d7 100644 --- a/openstackclient/tests/unit/identity/v2_0/test_user.py +++ b/openstackclient/tests/unit/identity/v2_0/test_user.py @@ -482,7 +482,7 @@ class TestUserList(TestUser): self.users_mock.list.assert_called_with(tenant_id=None) self.assertEqual(self.columns, columns) - self.assertItemsEqual(self.datalist, tuple(data)) + self.assertCountEqual(self.datalist, tuple(data)) def test_user_list_project(self): arglist = [ @@ -502,7 +502,7 @@ class TestUserList(TestUser): self.users_mock.list.assert_called_with(tenant_id=project_id) self.assertEqual(self.columns, columns) - self.assertItemsEqual(self.datalist, tuple(data)) + self.assertCountEqual(self.datalist, tuple(data)) def test_user_list_long(self): arglist = [ @@ -531,7 +531,7 @@ class TestUserList(TestUser): self.fake_user_l.email, True, ), ) - self.assertItemsEqual(datalist, tuple(data)) + self.assertCountEqual(datalist, tuple(data)) class TestUserSet(TestUser): @@ -819,4 +819,4 @@ class TestUserShow(TestUser): self.fake_user.name, self.fake_project.id, ) - self.assertItemsEqual(datalist, data) + self.assertCountEqual(datalist, data) |
