Skip to content

Commit

Permalink
Use assertRegex() instead of assertRegexpMatches().
Browse files Browse the repository at this point in the history
This fixes a few DeprecationWarnings.

Signed-off-by: Randy Barlow <randy@electronsweatshop.com>
  • Loading branch information
bowlofeggs authored and mergify[bot] committed Feb 4, 2019
1 parent f53cd15 commit 6ec0d01
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions bodhi/tests/server/services/test_overrides.py
Original file line number Diff line number Diff line change
Expand Up @@ -786,5 +786,5 @@ def test_override_expired_date(self):
resp = self.app.get('/overrides/bodhi-2.0-1.fc17',
status=200, headers={'Accept': 'text/html'})

self.assertRegexpMatches(str(resp), ('Expired\\n.*<span class="text-muted" '
'data-toggle="tooltip" title=".*"> just now </span>'))
self.assertRegex(str(resp), ('Expired\\n.*<span class="text-muted" '
'data-toggle="tooltip" title=".*"> just now </span>'))
16 changes: 8 additions & 8 deletions bodhi/tests/server/services/test_updates.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,8 +294,8 @@ def test_koji_config_url(self, publish, *args):

resp = self.app.get('/updates/%s' % nvr, headers={'Accept': 'text/html'})

self.assertRegexpMatches(str(resp), ('https://koji.fedoraproject.org/koji'
r'/search\?terms=.*\&amp;type=build\&amp;match=glob'))
self.assertRegex(str(resp), ('https://koji.fedoraproject.org/koji'
r'/search\?terms=.*\&amp;type=build\&amp;match=glob'))

@mock.patch(**mock_valid_requirements)
@mock.patch('bodhi.server.notifications.publish')
Expand All @@ -309,8 +309,8 @@ def test_koji_config_url_without_trailing_slash(self, publish, *args):

resp = self.app.get('/updates/%s' % nvr, headers={'Accept': 'text/html'})

self.assertRegexpMatches(str(resp), ('https://koji.fedoraproject.org/koji'
r'/search\?terms=.*\&amp;type=build\&amp;match=glob'))
self.assertRegex(str(resp), ('https://koji.fedoraproject.org/koji'
r'/search\?terms=.*\&amp;type=build\&amp;match=glob'))

@mock.patch(**mock_valid_requirements)
@mock.patch('bodhi.server.notifications.publish')
Expand All @@ -325,8 +325,8 @@ def test_koji_config_mock_url_without_trailing_slash(self, publish, *args):

resp = self.app.get('/updates/%s' % nvr, headers={'Accept': 'text/html'})

self.assertRegexpMatches(str(resp), ('https://host.org'
r'/search\?terms=.*\&amp;type=build\&amp;match=glob'))
self.assertRegex(str(resp), ('https://host.org'
r'/search\?terms=.*\&amp;type=build\&amp;match=glob'))

@mock.patch.dict('bodhi.server.validators.config', {'acl_system': u'dummy'})
@mock.patch(**mock_uuid4_version1)
Expand Down Expand Up @@ -1011,8 +1011,8 @@ def test_disabled_unspecified_severity_for_security_update(self):

resp = self.app.get('/updates/bodhi-2.0-1.fc17/edit',
headers={'accept': 'text/html'})
self.assertRegexpMatches(str(resp), ('<input type="radio" name="severity" '
'value="unspecified"\\n.*disabled="disabled"\\n.*>'))
self.assertRegex(str(resp), ('<input type="radio" name="severity" '
'value="unspecified"\\n.*disabled="disabled"\\n.*>'))


class TestUpdatesService(BaseTestCase):
Expand Down
4 changes: 2 additions & 2 deletions bodhi/tests/server/views/test_generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ def test_critical_update_link_home(self):

res = self.app.get('/', headers={'Accept': 'text/html'})

self.assertRegexpMatches(str(res), ('status=testing&critpath=True.*'
'Latest Critical Path Updates in Need of Testing'))
self.assertRegex(str(res), ('status=testing&critpath=True.*'
'Latest Critical Path Updates in Need of Testing'))

def test_markdown(self):
res = self.app.get('/markdown', {'text': 'wat'}, status=200)
Expand Down

0 comments on commit 6ec0d01

Please sign in to comment.