diff options
Diffstat (limited to 'windriver/titanium_cloud/proxy')
-rw-r--r-- | windriver/titanium_cloud/proxy/tests/test_service_proxy.py | 28 | ||||
-rw-r--r-- | windriver/titanium_cloud/proxy/urls.py | 4 | ||||
-rw-r--r-- | windriver/titanium_cloud/proxy/urlsV1.py | 4 |
3 files changed, 18 insertions, 18 deletions
diff --git a/windriver/titanium_cloud/proxy/tests/test_service_proxy.py b/windriver/titanium_cloud/proxy/tests/test_service_proxy.py index 15d46ae1..c206ba75 100644 --- a/windriver/titanium_cloud/proxy/tests/test_service_proxy.py +++ b/windriver/titanium_cloud/proxy/tests/test_service_proxy.py @@ -718,12 +718,12 @@ class TestServiceProxy(unittest.TestCase): response = self.client.head( "/api/multicloud-titaniumcloud/v0/windriver-hudson-dc_RegionOne/compute/v2.1/fcca3cc49d5e42caae15459e27103efc/servers", {}, HTTP_X_AUTH_TOKEN=MOCK_TOKEN_ID) - self.assertEquals(status.HTTP_200_OK, response.status_code) + self.assertEqual(status.HTTP_200_OK, response.status_code) def test_unauthorized_access(self): response = self.client.get( "/api/multicloud-titaniumcloud/v0/windriver-hudson-dc_RegionOne/compute/v2.1/fcca3cc49d5e42caae15459e27103efc/servers") - self.assertEquals(status.HTTP_403_FORBIDDEN, response.status_code) + self.assertEqual(status.HTTP_403_FORBIDDEN, response.status_code) @mock.patch.object(VimDriverUtils, 'get_vim_info') def test_expired_auth_token(self, mock_get_vim_info): @@ -732,7 +732,7 @@ class TestServiceProxy(unittest.TestCase): response = self.client.get( "/api/multicloud-titaniumcloud/v0/windriver-hudson-dc_RegionOne/compute/v2.1/fcca3cc49d5e42caae15459e27103efc/servers", {}, HTTP_X_AUTH_TOKEN=MOCK_TOKEN_ID) - self.assertEquals(status.HTTP_403_FORBIDDEN, response.status_code) + self.assertEqual(status.HTTP_403_FORBIDDEN, response.status_code) @mock.patch.object(VimDriverUtils, 'get_token_cache') @mock.patch.object(VimDriverUtils, 'get_vim_info') @@ -744,14 +744,14 @@ class TestServiceProxy(unittest.TestCase): url_part3 = "/v2.1/fcca3cc49d5e42caae15459e27103efc/servers" url = (url_part1 + servicetype + url_part3) response = self.client.get(url, {}, HTTP_X_AUTH_TOKEN=MOCK_TOKEN_ID) - self.assertEquals(status.HTTP_500_INTERNAL_SERVER_ERROR, response.status_code) + self.assertEqual(status.HTTP_500_INTERNAL_SERVER_ERROR, response.status_code) metadata_catalog = copy.deepcopy(MOCK_INTERNAL_METADATA_CATALOG) metadata_catalog[servicetype] = None mock_get_token_cache.return_value = (json.dumps(MOCK_AUTH_STATE), json.dumps(metadata_catalog)) response = self.client.get(url, {}, HTTP_X_AUTH_TOKEN=MOCK_TOKEN_ID) - self.assertEquals(status.HTTP_500_INTERNAL_SERVER_ERROR, response.status_code) + self.assertEqual(status.HTTP_500_INTERNAL_SERVER_ERROR, response.status_code) metadata_catalog = copy.deepcopy(MOCK_INTERNAL_METADATA_CATALOG) metadata_catalog[servicetype]['prefix'] = None @@ -759,7 +759,7 @@ class TestServiceProxy(unittest.TestCase): mock_get_token_cache.return_value = (json.dumps(MOCK_AUTH_STATE), json.dumps(metadata_catalog)) response = self.client.get(url, {}, HTTP_X_AUTH_TOKEN=MOCK_TOKEN_ID) - self.assertEquals(status.HTTP_500_INTERNAL_SERVER_ERROR, response.status_code) + self.assertEqual(status.HTTP_500_INTERNAL_SERVER_ERROR, response.status_code) @mock.patch.object(VimDriverUtils, 'get_vim_info') @mock.patch.object(VimDriverUtils, 'get_session') @@ -818,29 +818,29 @@ class TestServiceProxy(unittest.TestCase): "/api/multicloud-titaniumcloud/v0/windriver-hudson-dc_RegionOne/compute/v2.1/fcca3cc49d5e42caae15459e27103efc/servers", MOCK_POST_SERVER_REQUEST, HTTP_X_AUTH_TOKEN=MOCK_TOKEN_ID) - self.assertEquals(status.HTTP_202_ACCEPTED, response.status_code) + self.assertEqual(status.HTTP_202_ACCEPTED, response.status_code) context = response.json() - self.assertEquals(MOCK_TOKEN_ID, response['X-Subject-Token']) + self.assertEqual(MOCK_TOKEN_ID, response['X-Subject-Token']) self.assertIsNotNone(context['server']) # Retrieve resource response = self.client.get( "/api/multicloud-titaniumcloud/v0/windriver-hudson-dc_RegionOne/compute/v2.1/fcca3cc49d5e42caae15459e27103efc/servers", {}, HTTP_X_AUTH_TOKEN=MOCK_TOKEN_ID) - self.assertEquals(status.HTTP_200_OK, response.status_code) + self.assertEqual(status.HTTP_200_OK, response.status_code) context = response.json() - self.assertEquals(MOCK_TOKEN_ID, response['X-Subject-Token']) + self.assertEqual(MOCK_TOKEN_ID, response['X-Subject-Token']) self.assertIsNotNone(context['servers']) # Update resource response = self.client.get( "/api/multicloud-titaniumcloud/v0/windriver-hudson-dc_RegionOne/compute/v2.1/fcca3cc49d5e42caae15459e27103efc/servers", {}, HTTP_X_AUTH_TOKEN=MOCK_TOKEN_ID) - self.assertEquals(status.HTTP_200_OK, response.status_code) + self.assertEqual(status.HTTP_200_OK, response.status_code) context = response.json() - self.assertEquals(MOCK_TOKEN_ID, response['X-Subject-Token']) + self.assertEqual(MOCK_TOKEN_ID, response['X-Subject-Token']) self.assertIsNotNone(context['servers']) # simulate client to make the request @@ -848,5 +848,5 @@ class TestServiceProxy(unittest.TestCase): "/api/multicloud-titaniumcloud/v0/windriver-hudson-dc_RegionOne/compute/v2.1/fcca3cc49d5e42caae15459e27103efc/servers/324dfb7d-f4a9-419a-9a19-237df04b443b", HTTP_X_AUTH_TOKEN=MOCK_TOKEN_ID) - self.assertEquals(status.HTTP_204_NO_CONTENT, response.status_code) - self.assertEquals(MOCK_TOKEN_ID, response['X-Subject-Token']) + self.assertEqual(status.HTTP_204_NO_CONTENT, response.status_code) + self.assertEqual(MOCK_TOKEN_ID, response['X-Subject-Token']) diff --git a/windriver/titanium_cloud/proxy/urls.py b/windriver/titanium_cloud/proxy/urls.py index 22f714d1..7b33801d 100644 --- a/windriver/titanium_cloud/proxy/urls.py +++ b/windriver/titanium_cloud/proxy/urls.py @@ -19,7 +19,7 @@ from titanium_cloud.proxy.views import identityV3 from titanium_cloud.proxy.views import services from newton_base.proxy import dnsaasdelegate -urlpatterns = [ +URLPATTERNS = [ # url(r'^identity/v2)$', # identityV2.Tokens.as_view()), url(r'^identity/v3/auth/tokens/?$', @@ -38,4 +38,4 @@ urlpatterns = [ services.Services.as_view()), ] -urlpatterns = format_suffix_patterns(urlpatterns) +urlpatterns = format_suffix_patterns(URLPATTERNS) diff --git a/windriver/titanium_cloud/proxy/urlsV1.py b/windriver/titanium_cloud/proxy/urlsV1.py index 757ddf7e..88a8638a 100644 --- a/windriver/titanium_cloud/proxy/urlsV1.py +++ b/windriver/titanium_cloud/proxy/urlsV1.py @@ -19,7 +19,7 @@ from titanium_cloud.proxy.views import identityV3 from titanium_cloud.proxy.views import services from newton_base.proxy import dnsaasdelegate -urlpatterns = [ +URLPATTERNS = [ url(r'^identity/v3/auth/tokens/?$', identityV3.APIv1Tokens.as_view()), url(r'^identity/v3/?$', @@ -36,4 +36,4 @@ urlpatterns = [ services.APIv1Services.as_view()), ] -urlpatterns = format_suffix_patterns(urlpatterns) +urlpatterns = format_suffix_patterns(URLPATTERNS) |