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:
parent
b0e83084c2
commit
0b973a3cfe
@ -67,7 +67,7 @@ class CentralDecoratorTests(CentralTestCase):
|
|||||||
def mock_not_creating_new_zone(cls, context, record):
|
def mock_not_creating_new_zone(cls, context, record):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
self.assertRaisesRegexp(
|
self.assertRaisesRegex(
|
||||||
Exception,
|
Exception,
|
||||||
'Failed to determine zone id for '
|
'Failed to determine zone id for '
|
||||||
'synchronized operation',
|
'synchronized operation',
|
||||||
|
@ -158,7 +158,7 @@ class NS1BackendTestCase(designate.tests.TestCase):
|
|||||||
status_code=404,
|
status_code=404,
|
||||||
)
|
)
|
||||||
|
|
||||||
self.assertRaisesRegexp(
|
self.assertRaisesRegex(
|
||||||
exceptions.Backend,
|
exceptions.Backend,
|
||||||
'500 Server Error: None for url: '
|
'500 Server Error: None for url: '
|
||||||
'%s' % self.api_address,
|
'%s' % self.api_address,
|
||||||
@ -206,7 +206,7 @@ class NS1BackendTestCase(designate.tests.TestCase):
|
|||||||
req_mock.delete(self.api_address, status_code=500)
|
req_mock.delete(self.api_address, status_code=500)
|
||||||
req_mock.get(self.api_address, status_code=200)
|
req_mock.get(self.api_address, status_code=200)
|
||||||
|
|
||||||
self.assertRaisesRegexp(
|
self.assertRaisesRegex(
|
||||||
exceptions.Backend,
|
exceptions.Backend,
|
||||||
'500 Server Error: None for url: '
|
'500 Server Error: None for url: '
|
||||||
'%s' % self.api_address,
|
'%s' % self.api_address,
|
||||||
|
@ -161,7 +161,7 @@ class PDNS4BackendTestCase(designate.tests.TestCase):
|
|||||||
status_code=500,
|
status_code=500,
|
||||||
)
|
)
|
||||||
|
|
||||||
self.assertRaisesRegexp(
|
self.assertRaisesRegex(
|
||||||
exceptions.Backend,
|
exceptions.Backend,
|
||||||
'500 Server Error: None for url: '
|
'500 Server Error: None for url: '
|
||||||
'%s/localhost/zones' % self.base_address,
|
'%s/localhost/zones' % self.base_address,
|
||||||
@ -229,7 +229,7 @@ class PDNS4BackendTestCase(designate.tests.TestCase):
|
|||||||
status_code=404,
|
status_code=404,
|
||||||
)
|
)
|
||||||
|
|
||||||
self.assertRaisesRegexp(
|
self.assertRaisesRegex(
|
||||||
exceptions.Backend,
|
exceptions.Backend,
|
||||||
'500 Server Error: None for url: '
|
'500 Server Error: None for url: '
|
||||||
'%s/localhost/zones' % self.base_address,
|
'%s/localhost/zones' % self.base_address,
|
||||||
@ -255,7 +255,7 @@ class PDNS4BackendTestCase(designate.tests.TestCase):
|
|||||||
status_code=500,
|
status_code=500,
|
||||||
)
|
)
|
||||||
|
|
||||||
self.assertRaisesRegexp(
|
self.assertRaisesRegex(
|
||||||
exceptions.Backend,
|
exceptions.Backend,
|
||||||
'500 Server Error: None for url: '
|
'500 Server Error: None for url: '
|
||||||
'%s/localhost/zones' % self.base_address,
|
'%s/localhost/zones' % self.base_address,
|
||||||
@ -326,7 +326,7 @@ class PDNS4BackendTestCase(designate.tests.TestCase):
|
|||||||
status_code=200,
|
status_code=200,
|
||||||
)
|
)
|
||||||
|
|
||||||
self.assertRaisesRegexp(
|
self.assertRaisesRegex(
|
||||||
exceptions.Backend,
|
exceptions.Backend,
|
||||||
'500 Server Error: None for url: '
|
'500 Server Error: None for url: '
|
||||||
'%s/localhost/zones' % self.base_address,
|
'%s/localhost/zones' % self.base_address,
|
||||||
|
@ -312,7 +312,7 @@ class TestZoneActor(oslotest.base.BaseTestCase):
|
|||||||
)
|
)
|
||||||
|
|
||||||
def test_invalid_action(self):
|
def test_invalid_action(self):
|
||||||
self.assertRaisesRegexp(
|
self.assertRaisesRegex(
|
||||||
exceptions.BadAction, 'Unexpected action: BAD',
|
exceptions.BadAction, 'Unexpected action: BAD',
|
||||||
self.actor._validate_action, 'BAD'
|
self.actor._validate_action, 'BAD'
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user