Replace assertRaisesRegexp with assertRaisesRegex

This replaces the deprecated (in python 3.2) unittest.TestCase
method assertRaisesRegexp() with assertRaisesRegex()

Change-Id: I36c56032d4c3279d89c2b196a193196aad6aeeea
This commit is contained in:
M V P Nitesh 2017-05-22 14:47:50 +05:30
parent 5d8f5e3324
commit 525e9aa72c
1 changed files with 10 additions and 10 deletions

View File

@ -260,11 +260,11 @@ class DiscoverVersionTestCase(utils.TestCase):
manilaclient.API_MAX_VERSION = api_versions.APIVersion("2.3")
manilaclient.API_MIN_VERSION = api_versions.APIVersion("2.1")
self.assertRaisesRegexp(exceptions.UnsupportedVersion,
".*range is '2.4' to '2.7'.*",
api_versions.discover_version,
self.fake_client,
api_versions.APIVersion("2.3"))
self.assertRaisesRegex(exceptions.UnsupportedVersion,
".*range is '2.4' to '2.7'.*",
api_versions.discover_version,
self.fake_client,
api_versions.APIVersion("2.3"))
self.assertTrue(self.fake_client.services.server_api_version.called)
def test_server_is_too_old(self):
@ -347,8 +347,8 @@ class DiscoverVersionTestCase(utils.TestCase):
manilaclient.API_MAX_VERSION = api_versions.APIVersion("2.5")
manilaclient.API_MIN_VERSION = api_versions.APIVersion("2.5")
self.assertRaisesRegexp(exceptions.UnsupportedVersion,
".*range is '2.0' to '2.5'.*",
api_versions.discover_version,
self.fake_client,
api_versions.APIVersion("1.0"))
self.assertRaisesRegex(exceptions.UnsupportedVersion,
".*range is '2.0' to '2.5'.*",
api_versions.discover_version,
self.fake_client,
api_versions.APIVersion("1.0"))