Merge "Replace deprecated assertRaisesRegexp"

This commit is contained in:
Zuul 2022-06-28 16:27:35 +00:00 committed by Gerrit Code Review
commit 5e46c52c5c
1 changed files with 4 additions and 4 deletions

View File

@ -54,22 +54,22 @@ class TestAllocation(base.BaseTestCase):
def test_fail_if_incorrect_format(self):
allocations = ['incorrect_format']
self.assertRaisesRegexp(
self.assertRaisesRegex(
ValueError,
'Incorrect allocation',
allocation.parse_allocations, allocations)
allocations = ['=,']
self.assertRaisesRegexp(
self.assertRaisesRegex(
ValueError,
'2 is required',
allocation.parse_allocations, allocations)
allocations = ['abc=155']
self.assertRaisesRegexp(
self.assertRaisesRegex(
ValueError,
'Incorrect allocation',
allocation.parse_allocations, allocations)
allocations = ['abc=155,xyz=999']
self.assertRaisesRegexp(
self.assertRaisesRegex(
ValueError,
'parameter is required',
allocation.parse_allocations, allocations)