Replace assertRaisesRegexp with assertRaisesRegex
This replaces the deprecated (in python 3.2) unittest.TestCase method assertRaisesRegexp() with assertRaisesRegex(). Change-Id: I85025ad141f8436913ba192716435ce63e1e2d05
This commit is contained in:
@@ -236,12 +236,12 @@ class DiscoverVersionTestCase(utils.TestCase):
|
||||
api_versions.MIN_VERSION = client_min
|
||||
|
||||
if exp_range:
|
||||
self.assertRaisesRegexp(exceptions.UnsupportedVersion,
|
||||
".*range is '%s' to '%s'.*" %
|
||||
(server_min, server_max),
|
||||
api_versions.discover_version,
|
||||
self.fake_client,
|
||||
api_versions.APIVersion(requested_version))
|
||||
self.assertRaisesRegex(exceptions.UnsupportedVersion,
|
||||
".*range is '%s' to '%s'.*" %
|
||||
(server_min, server_max),
|
||||
api_versions.discover_version,
|
||||
self.fake_client,
|
||||
api_versions.APIVersion(requested_version))
|
||||
else:
|
||||
discovered_version = api_versions.discover_version(
|
||||
self.fake_client,
|
||||
|
@@ -529,10 +529,10 @@ class ShellTest(utils.TestCase):
|
||||
def test_rename_invalid_args(self):
|
||||
"""Ensure that error generated does not reference an HTTP code."""
|
||||
|
||||
self.assertRaisesRegexp(exceptions.ClientException,
|
||||
'(?!HTTP)',
|
||||
self.run_command,
|
||||
'rename volume-1234-abcd')
|
||||
self.assertRaisesRegex(exceptions.ClientException,
|
||||
'(?!HTTP)',
|
||||
self.run_command,
|
||||
'rename volume-1234-abcd')
|
||||
|
||||
def test_rename_snapshot(self):
|
||||
# basic rename with positional arguments
|
||||
|
Reference in New Issue
Block a user