summaryrefslogtreecommitdiff
path: root/heat/tests
diff options
context:
space:
mode:
authorStephen Finucane <stephenfin@redhat.com>2021-02-01 09:57:55 +0000
committerStephen Finucane <stephenfin@redhat.com>2021-02-01 11:15:59 +0000
commit57e9754093eec986b60d86e527e41c74b001b30a (patch)
treec78226619aa8c6564fc2c9435143e8fc4a1aec5c /heat/tests
parent32f9014207d3a3fa1e248d372f9f1d59c876ee1c (diff)
downloadheat-57e9754093eec986b60d86e527e41c74b001b30a.tar.gz
Switch to collections.abc.*
The abstract base classes previously defined in 'collections' were moved to 'collections.abc' in 3.3. The aliases will be removed in 3.10. Preempt this change now with a simple find-replace: $ ag -l 'collections.($TYPES)' | \ xargs sed -i 's/\(collections\)\.\($TYPES\)/\1.abc.\2/g' Where $TYPES is the list of moved ABCs from [1]. [1] https://docs.python.org/3/library/collections.abc.html Change-Id: Ia282479bb1d466bd2189ebb21b51d91e89b9581e Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Diffstat (limited to 'heat/tests')
-rw-r--r--heat/tests/openstack/nova/test_server.py2
-rw-r--r--heat/tests/test_resource.py2
2 files changed, 2 insertions, 2 deletions
diff --git a/heat/tests/openstack/nova/test_server.py b/heat/tests/openstack/nova/test_server.py
index f4aec2a81..9b36a533c 100644
--- a/heat/tests/openstack/nova/test_server.py
+++ b/heat/tests/openstack/nova/test_server.py
@@ -3305,7 +3305,7 @@ class ServersTest(common.HeatTestCase):
ws.resource_id = server.id
self.patchobject(self.fc.servers, 'get', return_value=server)
console_urls = ws._resolve_any_attribute('console_urls')
- self.assertIsInstance(console_urls, collections.Mapping)
+ self.assertIsInstance(console_urls, collections.abc.Mapping)
supported_consoles = ('novnc', 'xvpvnc', 'spice-html5', 'rdp-html5',
'serial', 'webmks')
self.assertEqual(set(supported_consoles),
diff --git a/heat/tests/test_resource.py b/heat/tests/test_resource.py
index 5bad17671..92e06857c 100644
--- a/heat/tests/test_resource.py
+++ b/heat/tests/test_resource.py
@@ -4433,7 +4433,7 @@ class TestResourceMapping(common.HeatTestCase):
def _check_mapping_func(self, func, module):
self.assertTrue(callable(func))
res = func()
- self.assertIsInstance(res, collections.Mapping)
+ self.assertIsInstance(res, collections.abc.Mapping)
for r_type, r_class in res.items():
self.assertIsInstance(r_type, str)
type_elements = r_type.split('::')