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: Ib0e10370366ee7bd76f102fad5205123567f97bf
This commit is contained in:
rajat29 2017-06-15 13:02:13 +05:30
parent dd284c4a31
commit 15e9265ee4
2 changed files with 8 additions and 8 deletions

View File

@ -429,9 +429,9 @@ pxe_ssh,192.168.122.2,stack,"KEY2",00:0b:d0:69:7e:58,6230""")
]
self.baremetal.http_client.os_ironic_api_version = '1.6'
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
self.assertRaisesRegexp(exceptions.InvalidConfiguration,
'OS_BAREMETAL_API_VERSION',
self.cmd.take_action, parsed_args)
self.assertRaisesRegex(exceptions.InvalidConfiguration,
'OS_BAREMETAL_API_VERSION',
self.cmd.take_action, parsed_args)
self.workflow.executions.create.assert_not_called()
def test_json_import_detect_suffix(self):
@ -520,9 +520,9 @@ pxe_ssh,192.168.122.2,stack,"KEY2",00:0b:d0:69:7e:58,6230""")
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
self.assertRaisesRegexp(exceptions.InvalidConfiguration,
'Invalid file extension',
self.cmd.take_action, parsed_args)
self.assertRaisesRegex(exceptions.InvalidConfiguration,
'Invalid file extension',
self.cmd.take_action, parsed_args)
def test_instack_yaml_import(self):

View File

@ -106,8 +106,8 @@ class TestCreateRAID(fakes.TestBaremetal):
]
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
self.assertRaisesRegexp(RuntimeError, 'cannot be parsed as YAML',
self.cmd.take_action, parsed_args)
self.assertRaisesRegex(RuntimeError, 'cannot be parsed as YAML',
self.cmd.take_action, parsed_args)
self.assertFalse(self.workflow.executions.create.called)
def test_bad_type(self):