s/assertItemsEqual/assertCountEqual/g

assertItemsEqual was renamed to assertCountEqual in Python 3, and the
testsuite is failing now - rename it.
See also https://six.readthedocs.io/#six.assertCountEqual

This unbreaks the testsuite.

Change-Id: I95c81cfd6ab9bc7384c585ef5aa625dad9a57caf
This commit is contained in:
Andreas Jaeger 2020-01-20 16:43:12 +01:00
parent 994eeb58f9
commit 30c4992796
2 changed files with 10 additions and 10 deletions

View File

@ -35,7 +35,7 @@ class HeatApiTests(test.APITestCase):
sort_dir='desc', sort_dir='desc',
sort_key='created_at', sort_key='created_at',
) )
self.assertItemsEqual(stacks, api_stacks) self.assertCountEqual(stacks, api_stacks)
self.assertFalse(has_more) self.assertFalse(has_more)
self.assertFalse(has_prev) self.assertFalse(has_prev)
@ -54,7 +54,7 @@ class HeatApiTests(test.APITestCase):
stacks, has_more, has_prev = api.heat.stacks_list(self.request, stacks, has_more, has_prev = api.heat.stacks_list(self.request,
sort_dir=sort_dir, sort_dir=sort_dir,
sort_key=sort_key) sort_key=sort_key)
self.assertItemsEqual(stacks, api_stacks) self.assertCountEqual(stacks, api_stacks)
self.assertFalse(has_more) self.assertFalse(has_more)
self.assertFalse(has_prev) self.assertFalse(has_prev)
heatclient.stacks.list.assert_called_once_with( heatclient.stacks.list.assert_called_once_with(
@ -76,7 +76,7 @@ class HeatApiTests(test.APITestCase):
sort_key=sort_key, sort_key=sort_key,
paginate=True) paginate=True)
expected_stacks = api_stacks[:page_size] expected_stacks = api_stacks[:page_size]
self.assertItemsEqual(stacks, expected_stacks) self.assertCountEqual(stacks, expected_stacks)
self.assertFalse(has_more) self.assertFalse(has_more)
self.assertFalse(has_prev) self.assertFalse(has_prev)
heatclient.stacks.list.assert_called_once_with( heatclient.stacks.list.assert_called_once_with(
@ -100,7 +100,7 @@ class HeatApiTests(test.APITestCase):
sort_key=sort_key, sort_key=sort_key,
paginate=True) paginate=True)
expected_stacks = api_stacks[:page_size] expected_stacks = api_stacks[:page_size]
self.assertItemsEqual(stacks, expected_stacks) self.assertCountEqual(stacks, expected_stacks)
self.assertFalse(has_more) self.assertFalse(has_more)
self.assertFalse(has_prev) self.assertFalse(has_prev)
heatclient.stacks.list.assert_called_once_with( heatclient.stacks.list.assert_called_once_with(
@ -127,7 +127,7 @@ class HeatApiTests(test.APITestCase):
sort_key=sort_key,) sort_key=sort_key,)
self.assertEqual(len(stacks), page_size) self.assertEqual(len(stacks), page_size)
self.assertItemsEqual(stacks, api_stacks[:page_size]) self.assertCountEqual(stacks, api_stacks[:page_size])
self.assertTrue(has_more) self.assertTrue(has_more)
self.assertTrue(has_prev) self.assertTrue(has_prev)
heatclient.stacks.list.assert_called_once_with( heatclient.stacks.list.assert_called_once_with(
@ -154,7 +154,7 @@ class HeatApiTests(test.APITestCase):
sort_key=sort_key,) sort_key=sort_key,)
self.assertEqual(len(stacks), page_size) self.assertEqual(len(stacks), page_size)
self.assertItemsEqual(stacks, api_stacks[:page_size]) self.assertCountEqual(stacks, api_stacks[:page_size])
self.assertTrue(has_more) self.assertTrue(has_more)
self.assertTrue(has_prev) self.assertTrue(has_prev)
heatclient.stacks.list.assert_called_once_with( heatclient.stacks.list.assert_called_once_with(
@ -235,7 +235,7 @@ class HeatApiTests(test.APITestCase):
returned_snapshots = api.heat.snapshot_list(self.request, stack_id) returned_snapshots = api.heat.snapshot_list(self.request, stack_id)
self.assertItemsEqual(returned_snapshots, snapshot_list) self.assertCountEqual(returned_snapshots, snapshot_list)
heatclient.stacks.snapshot_list.assert_called_once_with(stack_id) heatclient.stacks.snapshot_list.assert_called_once_with(stack_id)
def test_get_template_files_with_template_data(self): def test_get_template_files_with_template_data(self):
@ -333,7 +333,7 @@ class HeatApiTests(test.APITestCase):
template_versions = api.heat.template_version_list(self.request) template_versions = api.heat.template_version_list(self.request)
self.assertItemsEqual(template_versions, api_template_versions) self.assertCountEqual(template_versions, api_template_versions)
heatclient.template_versions.list.assert_called_once_with() heatclient.template_versions.list.assert_called_once_with()
def test_template_function_list(self): def test_template_function_list(self):
@ -347,6 +347,6 @@ class HeatApiTests(test.APITestCase):
template_functions = api.heat.template_function_list( template_functions = api.heat.template_function_list(
self.request, template_version) self.request, template_version)
self.assertItemsEqual(template_functions, api_template_functions) self.assertCountEqual(template_functions, api_template_functions)
heatclient.template_versions.get.assert_called_once_with( heatclient.template_versions.get.assert_called_once_with(
template_version) template_version)

View File

@ -1,6 +1,6 @@
[tox] [tox]
envlist = py36,py37,py3-{dj111,dj22},pep8,releasenotes envlist = py36,py37,py3-{dj111,dj22},pep8,releasenotes
minversion = 3.1.1 #minversion = 3.1.1
skipsdist = True skipsdist = True
ignore_basepython_conflict = True ignore_basepython_conflict = True