Use assertRegex instead of assertRegexpMatches

In Python3, assertRegexpMatches & assertNotRegexpMatches
are deprecated in favor of assertRegex and assertNotRegex

Change-Id: I770e45ea04b799fa102887275acc95cdddbfd162
This commit is contained in:
wangqi 2018-05-17 08:28:21 +00:00 committed by Xinni Ge
parent 3812cc2667
commit df56338490

View File

@ -445,7 +445,7 @@ class StackTests(test.TestCase):
# ensure the fields were rendered in the correct order # ensure the fields were rendered in the correct order
regex = re.compile('^.*>first_param<.*>middle_param<.*>last_param<.*$', regex = re.compile('^.*>first_param<.*>middle_param<.*>last_param<.*$',
flags=re.DOTALL) flags=re.DOTALL)
self.assertRegexpMatches(res.content.decode('utf-8'), regex) self.assertRegex(res.content.decode('utf-8'), regex)
@test.create_mocks({api.heat: ('stack_create', 'template_validate')}) @test.create_mocks({api.heat: ('stack_create', 'template_validate')})
def test_launch_stack_parameter_types(self): def test_launch_stack_parameter_types(self):