Skip to content

Commit 5aaef29

Browse files
committed
tests: use six.assertRegex instead of deprecated assertRegexpMatches
1 parent 99d28bc commit 5aaef29

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

tests/searchcommands/test_search_command.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ def test_process_scpv1(self):
127127
result = BytesIO()
128128

129129
self.assertRaises(SystemExit, command.process, argv, ofile=result)
130-
self.assertRegexpMatches(result.getvalue().decode('UTF-8'), expected)
130+
six.assertRegex(self, result.getvalue().decode('UTF-8'), expected)
131131

132132
# TestCommand.process should return configuration settings on Getinfo probe
133133

@@ -294,7 +294,8 @@ def test_process_scpv1(self):
294294
command.process(argv, ifile, ofile=result)
295295
except SystemExit as error:
296296
self.assertNotEqual(error.code, 0)
297-
self.assertRegexpMatches(
297+
six.assertRegex(
298+
self,
298299
result.getvalue().decode('UTF-8'),
299300
r'^error_message=RuntimeError at ".+", line \d+ : Testing\r\n\r\n$')
300301
except BaseException as error:
@@ -318,7 +319,8 @@ def test_process_scpv1(self):
318319
except BaseException as error:
319320
self.fail('Expected no exception, but caught {}: {}'.format(type(error).__name__, error))
320321
else:
321-
self.assertRegexpMatches(
322+
six.assertRegex(
323+
self,
322324
result.getvalue().decode('UTF-8'),
323325
r'^\r\n'
324326
r'('
@@ -705,7 +707,8 @@ def test_process_scpv2(self):
705707
r'logging_configuration=\\\".+\\\" logging_level=\\\"WARNING\\\" record=\\\"f\\\" ' \
706708
r'required_option_1=\\\"value_1\\\" required_option_2=\\\"value_2\\\" show_configuration=\\\"f\\\"\"\]\]\}'
707709

708-
self.assertRegexpMatches(
710+
six.assertRegex(
711+
self,
709712
result.getvalue().decode('utf-8'),
710713
r'^chunked 1.0,2,0\n'
711714
r'\{\}\n'

0 commit comments

Comments
 (0)