Replace deprecated assertRaisesRegexp

The assertRaisesRegexp method has been deprecated since it was renamed
to assertRaisesRegex in Python 3.2 .

https: //docs.python.org/3/library/unittest.html#deprecated-aliases
Change-Id: I3d6a1014efd3e29bd45ab0aad0def33f22af95c1
This commit is contained in:
Takashi Kajinami 2021-08-18 12:07:29 +09:00
parent b0e83084c2
commit 0b973a3cfe
4 changed files with 8 additions and 8 deletions

View File

@ -67,7 +67,7 @@ class CentralDecoratorTests(CentralTestCase):
def mock_not_creating_new_zone(cls, context, record):
pass
self.assertRaisesRegexp(
self.assertRaisesRegex(
Exception,
'Failed to determine zone id for '
'synchronized operation',

View File

@ -158,7 +158,7 @@ class NS1BackendTestCase(designate.tests.TestCase):
status_code=404,
)
self.assertRaisesRegexp(
self.assertRaisesRegex(
exceptions.Backend,
'500 Server Error: None for url: '
'%s' % self.api_address,
@ -206,7 +206,7 @@ class NS1BackendTestCase(designate.tests.TestCase):
req_mock.delete(self.api_address, status_code=500)
req_mock.get(self.api_address, status_code=200)
self.assertRaisesRegexp(
self.assertRaisesRegex(
exceptions.Backend,
'500 Server Error: None for url: '
'%s' % self.api_address,

View File

@ -161,7 +161,7 @@ class PDNS4BackendTestCase(designate.tests.TestCase):
status_code=500,
)
self.assertRaisesRegexp(
self.assertRaisesRegex(
exceptions.Backend,
'500 Server Error: None for url: '
'%s/localhost/zones' % self.base_address,
@ -229,7 +229,7 @@ class PDNS4BackendTestCase(designate.tests.TestCase):
status_code=404,
)
self.assertRaisesRegexp(
self.assertRaisesRegex(
exceptions.Backend,
'500 Server Error: None for url: '
'%s/localhost/zones' % self.base_address,
@ -255,7 +255,7 @@ class PDNS4BackendTestCase(designate.tests.TestCase):
status_code=500,
)
self.assertRaisesRegexp(
self.assertRaisesRegex(
exceptions.Backend,
'500 Server Error: None for url: '
'%s/localhost/zones' % self.base_address,
@ -326,7 +326,7 @@ class PDNS4BackendTestCase(designate.tests.TestCase):
status_code=200,
)
self.assertRaisesRegexp(
self.assertRaisesRegex(
exceptions.Backend,
'500 Server Error: None for url: '
'%s/localhost/zones' % self.base_address,

View File

@ -312,7 +312,7 @@ class TestZoneActor(oslotest.base.BaseTestCase):
)
def test_invalid_action(self):
self.assertRaisesRegexp(
self.assertRaisesRegex(
exceptions.BadAction, 'Unexpected action: BAD',
self.actor._validate_action, 'BAD'
)