Skip to content

Commit 11492ed

Browse files
committed
parse values from config file case sensitive
1 parent 5c7b2cc commit 11492ed

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

source/confParser.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ def parse_defaults_from_config_file(fileName='config.ini'):
4949
conf_file = os.path.join(dirname, fileName)
5050
if os.path.isfile(conf_file):
5151
config = configparser.ConfigParser()
52+
config.optionxform = str
5253
config.read(conf_file)
5354
for sect in config.sections():
5455
for name, value in config.items(sect):

tests/test_params.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def test_case02():
1414
def test_case03():
1515
result = parse_defaults_from_config_file()
1616
elements = list(result.keys())
17-
mandatoryItems = ['port', 'serverport']
17+
mandatoryItems = ['port', 'serverPort']
1818
assert all(item in elements for item in mandatoryItems)
1919

2020

@@ -26,4 +26,4 @@ def test_case04():
2626

2727
def test_case05():
2828
result = parse_defaults_from_config_file()
29-
assert int(result['port']) == 4242 and int(result['serverport']) == 9084
29+
assert int(result['port']) == 4242 and int(result['serverPort']) == 9084

0 commit comments

Comments
 (0)