forked from loafle/openapi-generator-original
Fixes Python client Configuration class so each instance uses its own dicts (#4485)
This commit is contained in:
committed by
William Cheng
parent
2b36383308
commit
a1a9e70fe4
36
samples/client/petstore/python/tests/test_configuration.py
Normal file
36
samples/client/petstore/python/tests/test_configuration.py
Normal file
@@ -0,0 +1,36 @@
|
||||
# coding: utf-8
|
||||
|
||||
# flake8: noqa
|
||||
|
||||
"""
|
||||
Run the tests.
|
||||
$ pip install nose (optional)
|
||||
$ cd petstore_api-python
|
||||
$ nosetests -v
|
||||
"""
|
||||
from __future__ import absolute_import
|
||||
|
||||
import unittest
|
||||
|
||||
import petstore_api
|
||||
|
||||
|
||||
class TestConfiguration(unittest.TestCase):
|
||||
"""Animal unit test stubs"""
|
||||
|
||||
def setUp(self):
|
||||
pass
|
||||
|
||||
def tearDown(self):
|
||||
pass
|
||||
|
||||
def testConfiguration(self):
|
||||
# check that different instances use different dictionaries
|
||||
c1 = petstore_api.Configuration()
|
||||
c2 = petstore_api.Configuration()
|
||||
assert id(c1.api_key) != id(c2.api_key)
|
||||
assert id(c1.api_key_prefix) != id(c2.api_key_prefix)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
Reference in New Issue
Block a user