Replace assertRaisesRegexp with assertRaisesRegex
assertRaisesRegexp was renamed to assertRaisesRegex in Py3.2 For more details, please check: https://docs.python.org/3/library/ unittest.html#unittest.TestCase.assertRaisesRegex Change-Id: I705c958c0dbf1daa409ed29ccbc038426298c306 Closes-Bug: #1436957
This commit is contained in:
parent
5a045e036d
commit
cae44c7eea
@ -61,7 +61,7 @@ class TestConfigParsing(TestConfig):
|
||||
# test a config that has multiple keys for a top-level entry
|
||||
def test_config_multikey_node(self):
|
||||
config = self.load_config_file('multi_key_node.yaml')
|
||||
self.assertRaisesRegexp(BlockDeviceSetupException,
|
||||
self.assertRaisesRegex(BlockDeviceSetupException,
|
||||
"Config entry top-level should be a single "
|
||||
"dict:",
|
||||
config_tree_to_graph,
|
||||
@ -101,7 +101,7 @@ class TestCreateGraph(TestGraphGeneration):
|
||||
# Test a graph with bad edge pointing to an invalid node
|
||||
def test_invalid_missing(self):
|
||||
config = self.load_config_file('bad_edge_graph.yaml')
|
||||
self.assertRaisesRegexp(BlockDeviceSetupException,
|
||||
self.assertRaisesRegex(BlockDeviceSetupException,
|
||||
"Edge not defined: this_is_not_a_node",
|
||||
create_graph,
|
||||
config, self.fake_default_config)
|
||||
@ -109,7 +109,7 @@ class TestCreateGraph(TestGraphGeneration):
|
||||
# Test a graph with bad edge pointing to an invalid node
|
||||
def test_duplicate_name(self):
|
||||
config = self.load_config_file('duplicate_name.yaml')
|
||||
self.assertRaisesRegexp(BlockDeviceSetupException,
|
||||
self.assertRaisesRegex(BlockDeviceSetupException,
|
||||
"Duplicate node name: "
|
||||
"this_is_a_duplicate",
|
||||
create_graph,
|
||||
|
@ -96,12 +96,12 @@ class TestState(TestStateBase):
|
||||
# simulate the state somehow going missing, and ensure that
|
||||
# later calls notice
|
||||
os.unlink(state_file)
|
||||
self.assertRaisesRegexp(BlockDeviceSetupException,
|
||||
self.assertRaisesRegex(BlockDeviceSetupException,
|
||||
"State dump not found",
|
||||
bd_obj.cmd_cleanup)
|
||||
self.assertRaisesRegexp(BlockDeviceSetupException,
|
||||
self.assertRaisesRegex(BlockDeviceSetupException,
|
||||
"State dump not found",
|
||||
bd_obj.cmd_writefstab)
|
||||
self.assertRaisesRegexp(BlockDeviceSetupException,
|
||||
self.assertRaisesRegex(BlockDeviceSetupException,
|
||||
"State dump not found",
|
||||
bd_obj.cmd_delete)
|
||||
|
Loading…
Reference in New Issue
Block a user