From c1d5fe0c771f13f71f21fbb0a63a5ecb09a4bf71 Mon Sep 17 00:00:00 2001 From: Arun Date: Tue, 15 Oct 2019 12:24:24 +0530 Subject: [PATCH] Run all test cases against petstore server (#4150) --- samples/client/petstore/python/tests/test_api_client.py | 1 - samples/client/petstore/python/tests/test_pet_api.py | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/samples/client/petstore/python/tests/test_api_client.py b/samples/client/petstore/python/tests/test_api_client.py index a41dbaba9c9..c9b9edd86c4 100644 --- a/samples/client/petstore/python/tests/test_api_client.py +++ b/samples/client/petstore/python/tests/test_api_client.py @@ -27,7 +27,6 @@ class ApiClientTests(unittest.TestCase): def test_configuration(self): config = petstore_api.Configuration() - config.host = 'http://localhost/' config.api_key['api_key'] = '123456' config.api_key_prefix['api_key'] = 'PREFIX' diff --git a/samples/client/petstore/python/tests/test_pet_api.py b/samples/client/petstore/python/tests/test_pet_api.py index 4f38fbd6e17..80d34f6b5f2 100644 --- a/samples/client/petstore/python/tests/test_pet_api.py +++ b/samples/client/petstore/python/tests/test_pet_api.py @@ -24,7 +24,7 @@ import json import urllib3 -HOST = 'http://localhost/v2' +HOST = 'http://petstore.swagger.io/v2' class TimeoutWithEqual(urllib3.Timeout): @@ -104,13 +104,13 @@ class PetApiTests(unittest.TestCase): mock_pool = MockPoolManager(self) self.api_client.rest_client.pool_manager = mock_pool - mock_pool.expect_request('POST', 'http://localhost/v2/pet', + mock_pool.expect_request('POST', HOST + '/pet', body=json.dumps(self.api_client.sanitize_for_serialization(self.pet)), headers={'Content-Type': 'application/json', 'Authorization': 'Bearer ', 'User-Agent': 'OpenAPI-Generator/1.0.0/python'}, preload_content=True, timeout=TimeoutWithEqual(total=5)) - mock_pool.expect_request('POST', 'http://localhost/v2/pet', + mock_pool.expect_request('POST', HOST + '/pet', body=json.dumps(self.api_client.sanitize_for_serialization(self.pet)), headers={'Content-Type': 'application/json', 'Authorization': 'Bearer ',