From c3717f87a65f06373326770aeb29196bafcc4faa Mon Sep 17 00:00:00 2001 From: zhengwei6082 Date: Fri, 10 Nov 2017 15:51:52 +0800 Subject: [PATCH] Use assertRegex instead of assertRegexpMatches In Python3, assertRegexpMatches & assertNotRegexpMatches are deprecated in favor of assertRegex and assertNotRegex Change-Id: I26e262695da4e18a0943bfec297cf33801d2732e --- functionaltests/api/v1/functional/test_containers.py | 4 ++-- functionaltests/api/v1/functional/test_orders.py | 2 +- functionaltests/api/v1/functional/test_secrets.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/functionaltests/api/v1/functional/test_containers.py b/functionaltests/api/v1/functional/test_containers.py index bb7f0c0e3..c1042d56b 100644 --- a/functionaltests/api/v1/functional/test_containers.py +++ b/functionaltests/api/v1/functional/test_containers.py @@ -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 @@ -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): diff --git a/functionaltests/api/v1/functional/test_orders.py b/functionaltests/api/v1/functional/test_orders.py index 0dafc21dc..770ddfce9 100644 --- a/functionaltests/api/v1/functional/test_orders.py +++ b/functionaltests/api/v1/functional/test_orders.py @@ -554,7 +554,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): diff --git a/functionaltests/api/v1/functional/test_secrets.py b/functionaltests/api/v1/functional/test_secrets.py index ff623e2d3..29a344932 100644 --- a/functionaltests/api/v1/functional/test_secrets.py +++ b/functionaltests/api/v1/functional/test_secrets.py @@ -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',