From 716ae3ad3ef8e2f5d3fdd7ad7d20043c676e995b Mon Sep 17 00:00:00 2001 From: M V P Nitesh Date: Mon, 22 May 2017 13:12:32 +0530 Subject: [PATCH] Replace assertRaisesRegexp with assertRaisesRegex This replaces the deprecated (in python 3.2) unittest.TestCase method assertRaisesRegexp() with assertRaisesRegex() Change-Id: I4167b0d80f6e702fae29065eed1f00192f7c6f3e --- zunclient/tests/unit/v1/test_containers.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/zunclient/tests/unit/v1/test_containers.py b/zunclient/tests/unit/v1/test_containers.py index f6211fcb..d6767f84 100644 --- a/zunclient/tests/unit/v1/test_containers.py +++ b/zunclient/tests/unit/v1/test_containers.py @@ -294,10 +294,10 @@ class ContainerManagerTest(testtools.TestCase): def test_container_create_fail(self): create_container_fail = copy.deepcopy(CREATE_CONTAINER1) create_container_fail["wrong_key"] = "wrong" - self.assertRaisesRegexp(exceptions.InvalidAttribute, - ("Key must be in %s" % - ','.join(containers.CREATION_ATTRIBUTES)), - self.mgr.create, **create_container_fail) + self.assertRaisesRegex(exceptions.InvalidAttribute, + ("Key must be in %s" % + ','.join(containers.CREATION_ATTRIBUTES)), + self.mgr.create, **create_container_fail) self.assertEqual([], self.api.calls) def test_containers_list(self): @@ -499,10 +499,10 @@ class ContainerManagerTest(testtools.TestCase): def test_container_run_fail(self): run_container_fail = copy.deepcopy(CREATE_CONTAINER1) run_container_fail["wrong_key"] = "wrong" - self.assertRaisesRegexp(exceptions.InvalidAttribute, - ("Key must be in %s" % - ','.join(containers.CREATION_ATTRIBUTES)), - self.mgr.run, **run_container_fail) + self.assertRaisesRegex(exceptions.InvalidAttribute, + ("Key must be in %s" % + ','.join(containers.CREATION_ATTRIBUTES)), + self.mgr.run, **run_container_fail) self.assertEqual([], self.api.calls) def test_containers_rename(self):