Skip to content

Commit d549eb1

Browse files
author
Peejai
committed
fix more tests
1 parent aa18cad commit d549eb1

3 files changed

Lines changed: 16 additions & 3 deletions

File tree

samples/openapi3/client/petstore/python-pydantic-v1/tests/test_api_exception.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
HOST = 'http://localhost/v2'
2121

22+
2223
class ApiExceptionTests(unittest.TestCase):
2324

2425
def setUp(self):

samples/openapi3/client/petstore/python-pydantic-v1/tests/test_api_validation.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,22 @@
1414
import unittest
1515

1616
import petstore_api
17+
from petstore_api import Configuration
1718
from petstore_api.rest import ApiException
1819
from pydantic import BaseModel, ValidationError
1920

2021
from .util import id_gen
2122

23+
HOST = 'http://localhost/v2'
24+
2225

2326
class ApiExceptionTests(unittest.TestCase):
2427

2528
def setUp(self):
26-
self.api_client = petstore_api.ApiClient()
29+
config = Configuration()
30+
config.host = HOST
31+
config.access_token = 'ACCESS_TOKEN'
32+
self.api_client = petstore_api.ApiClient(config)
2733
self.pet_api = petstore_api.PetApi(self.api_client)
2834
self.setUpModels()
2935

samples/openapi3/client/petstore/python-pydantic-v1/tests/test_store_api.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,19 @@
1414
import unittest
1515

1616
import petstore_api
17-
from petstore_api.rest import ApiException
17+
from petstore_api import Configuration
18+
19+
HOST = 'http://localhost/v2'
1820

1921

2022
class StoreApiTests(unittest.TestCase):
2123

2224
def setUp(self):
23-
self.store_api = petstore_api.StoreApi()
25+
config = Configuration()
26+
config.host = HOST
27+
config.access_token = 'ACCESS_TOKEN'
28+
self.api_client = petstore_api.ApiClient(config)
29+
self.store_api = petstore_api.StoreApi(self.api_client)
2430

2531
def tearDown(self):
2632
# sleep 1 sec between two every 2 tests

0 commit comments

Comments
 (0)