Replace assertRaisesRegexp with assertRaisesRegex
This replaces the deprecated (in python 3.2) unittest.TestCase method assertRaisesRegexp() with assertRaisesRegex() Change-Id: I4167b0d80f6e702fae29065eed1f00192f7c6f3e
This commit is contained in:
@@ -294,10 +294,10 @@ class ContainerManagerTest(testtools.TestCase):
|
|||||||
def test_container_create_fail(self):
|
def test_container_create_fail(self):
|
||||||
create_container_fail = copy.deepcopy(CREATE_CONTAINER1)
|
create_container_fail = copy.deepcopy(CREATE_CONTAINER1)
|
||||||
create_container_fail["wrong_key"] = "wrong"
|
create_container_fail["wrong_key"] = "wrong"
|
||||||
self.assertRaisesRegexp(exceptions.InvalidAttribute,
|
self.assertRaisesRegex(exceptions.InvalidAttribute,
|
||||||
("Key must be in %s" %
|
("Key must be in %s" %
|
||||||
','.join(containers.CREATION_ATTRIBUTES)),
|
','.join(containers.CREATION_ATTRIBUTES)),
|
||||||
self.mgr.create, **create_container_fail)
|
self.mgr.create, **create_container_fail)
|
||||||
self.assertEqual([], self.api.calls)
|
self.assertEqual([], self.api.calls)
|
||||||
|
|
||||||
def test_containers_list(self):
|
def test_containers_list(self):
|
||||||
@@ -499,10 +499,10 @@ class ContainerManagerTest(testtools.TestCase):
|
|||||||
def test_container_run_fail(self):
|
def test_container_run_fail(self):
|
||||||
run_container_fail = copy.deepcopy(CREATE_CONTAINER1)
|
run_container_fail = copy.deepcopy(CREATE_CONTAINER1)
|
||||||
run_container_fail["wrong_key"] = "wrong"
|
run_container_fail["wrong_key"] = "wrong"
|
||||||
self.assertRaisesRegexp(exceptions.InvalidAttribute,
|
self.assertRaisesRegex(exceptions.InvalidAttribute,
|
||||||
("Key must be in %s" %
|
("Key must be in %s" %
|
||||||
','.join(containers.CREATION_ATTRIBUTES)),
|
','.join(containers.CREATION_ATTRIBUTES)),
|
||||||
self.mgr.run, **run_container_fail)
|
self.mgr.run, **run_container_fail)
|
||||||
self.assertEqual([], self.api.calls)
|
self.assertEqual([], self.api.calls)
|
||||||
|
|
||||||
def test_containers_rename(self):
|
def test_containers_rename(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user