Skip to content

Commit

Permalink
address PR requests
Browse files Browse the repository at this point in the history
  • Loading branch information
ZeeD committed Jun 17, 2024
1 parent b269b63 commit 197a492
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ conf = {{{packageName}}}.Configuration(
"""

_default = None
__debug = False

def __init__(self, host=None,
api_key=None, api_key_prefix=None,
Expand Down Expand Up @@ -217,6 +216,8 @@ conf = {{{packageName}}}.Configuration(
"""
if debug is not None:
self.debug = debug
else:
self.__debug = False
"""Debug switch
"""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ class Configuration:
"""

_default = None
__debug = False

def __init__(self, host=None,
api_key=None, api_key_prefix=None,
Expand Down Expand Up @@ -146,6 +145,8 @@ def __init__(self, host=None,
"""
if debug is not None:
self.debug = debug
else:
self.__debug = False
"""Debug switch
"""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ class Configuration:
"""

_default = None
__debug = False

def __init__(self, host=None,
api_key=None, api_key_prefix=None,
Expand Down Expand Up @@ -146,6 +145,8 @@ def __init__(self, host=None,
"""
if debug is not None:
self.debug = debug
else:
self.__debug = False
"""Debug switch
"""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ class Configuration:
"""

_default = None
__debug = False

def __init__(self, host=None,
api_key=None, api_key_prefix=None,
Expand Down Expand Up @@ -210,6 +209,8 @@ def __init__(self, host=None,
"""
if debug is not None:
self.debug = debug
else:
self.__debug = False
"""Debug switch
"""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ class Configuration:
"""

_default = None
__debug = False

def __init__(self, host=None,
api_key=None, api_key_prefix=None,
Expand Down Expand Up @@ -211,6 +210,8 @@ def __init__(self, host=None,
"""
if debug is not None:
self.debug = debug
else:
self.__debug = False
"""Debug switch
"""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,12 @@ def test_get_host_from_settings(self):

def testConfigurationDebug(self):
for debug, expected in [(True, True), (False, False), (None, False)]:
with self.subTest(debug=debug, expected=expected):
with self.subTest('expicitly passing debug parameter', debug=debug, expected=expected):
c = petstore_api.Configuration(debug=debug)
self.assertEqual(expected, c.debug)
with self.subTest(expected=False):
with self.subTest('not passing debug parameter'):
c = petstore_api.Configuration()
self.assertEqual(expected, c.debug)
self.assertFalse(c.debug)

if __name__ == '__main__':
unittest.main()

0 comments on commit 197a492

Please sign in to comment.