Merge "Use assertRegex instead of assertRegexpMatches"

This commit is contained in:
Zuul 2017-12-15 22:06:54 +00:00 committed by Gerrit Code Review
commit a74f898752
4 changed files with 9 additions and 9 deletions

View File

@ -231,7 +231,7 @@ class GenericContainersTestCase(BaseContainerTestCase):
# get Location field from result and assert that it is NOT the
# malicious one.
regex = '.*{0}.*'.format(malicious_hostname)
self.assertNotRegexpMatches(resp.headers['location'], regex)
self.assertNotRegex(resp.headers['location'], regex)
@testcase.skipIf(base.conf_host_href_used, 'response href using '
'CONF.host_href instead of wsgi request')
@ -254,7 +254,7 @@ class GenericContainersTestCase(BaseContainerTestCase):
extra_headers=changed_host_header)
# Assert that returned href has provided proxy hostname
regex = '.*{0}.*'.format(another_proxy_hostname)
self.assertRegexpMatches(resp.model.container_ref, regex)
self.assertRegex(resp.model.container_ref, regex)
@utils.parameterized_test_case
@ -348,7 +348,7 @@ class RSAContainersTestCase(BaseContainerTestCase):
# get Location field from result and assert that it is NOT the
# malicious one.
regex = '.*{0}.*'.format(malicious_hostname)
self.assertNotRegexpMatches(resp.headers['location'], regex)
self.assertNotRegex(resp.headers['location'], regex)
@testcase.skipIf(base.conf_host_href_used, 'response href using '
'CONF.host_href instead of wsgi request')
@ -371,7 +371,7 @@ class RSAContainersTestCase(BaseContainerTestCase):
extra_headers=changed_host_header)
# Assert that returned href has provided proxy hostname
regex = '.*{0}.*'.format(another_proxy_hostname)
self.assertRegexpMatches(resp.model.container_ref, regex)
self.assertRegex(resp.model.container_ref, regex)
class ContainersPagingTestCase(base.PagingTestCase):

View File

@ -541,7 +541,7 @@ class OrdersTestCase(base.TestCase):
# get Location field from result and assert that it is NOT the
# malicious one.
regex = '.*{0}.*'.format(malicious_hostname)
self.assertNotRegexpMatches(resp.headers['location'], regex)
self.assertNotRegex(resp.headers['location'], regex)
@testcase.skipIf(base.conf_host_href_used, 'response href using '
'CONF.host_href instead of wsgi request')
@ -564,7 +564,7 @@ class OrdersTestCase(base.TestCase):
order_ref, extra_headers=changed_host_header)
# Assert that returned href has provided proxy hostname
regex = '.*{0}.*'.format(another_proxy_hostname)
self.assertRegexpMatches(order_resp.model.order_ref, regex)
self.assertRegex(order_resp.model.order_ref, regex)
@testcase.attr('positive')
def test_encryption_using_generated_key(self):

View File

@ -966,7 +966,7 @@ class SecretsTestCase(base.TestCase):
# get Location field from result and assert that it is NOT the
# malicious one.
regex = '.*{0}.*'.format(malicious_hostname)
self.assertNotRegexpMatches(resp.headers['location'], regex)
self.assertNotRegex(resp.headers['location'], regex)
@testcase.skipIf(base.conf_host_href_used, 'response href using '
'CONF.host_href instead of wsgi request')
@ -991,7 +991,7 @@ class SecretsTestCase(base.TestCase):
secret_ref, extra_headers=changed_host_header)
# Check returned href has provided proxy hostname
regex = '.*{0}.*'.format(another_proxy_hostname)
self.assertRegexpMatches(resp.model.secret_ref, regex)
self.assertRegex(resp.model.secret_ref, regex)
@utils.parameterized_dataset({
'symmetric': ['symmetric',

View File

@ -238,4 +238,4 @@ class ConsumersTestCase(base.TestCase):
# get Location field from result and assert that it is NOT the
# malicious one.
regex = '.*{0}.*'.format(malicious_hostname)
self.assertNotRegexpMatches(resp.headers['location'], regex)
self.assertNotRegex(resp.headers['location'], regex)