File tree Expand file tree Collapse file tree
samples/openapi3/client/petstore/python-pydantic-v1/tests Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1919
2020HOST = 'http://localhost/v2'
2121
22+
2223class ApiExceptionTests (unittest .TestCase ):
2324
2425 def setUp (self ):
Original file line number Diff line number Diff line change 1414import unittest
1515
1616import petstore_api
17+ from petstore_api import Configuration
1718from petstore_api .rest import ApiException
1819from pydantic import BaseModel , ValidationError
1920
2021from .util import id_gen
2122
23+ HOST = 'http://localhost/v2'
24+
2225
2326class 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
Original file line number Diff line number Diff line change 1414import unittest
1515
1616import petstore_api
17- from petstore_api .rest import ApiException
17+ from petstore_api import Configuration
18+
19+ HOST = 'http://localhost/v2'
1820
1921
2022class 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
You can’t perform that action at this time.
0 commit comments