fix(config): make config file keys case sensitive
Since the configparser library by default parses keys case insensitive (all lowercase), certain mappings, especially in the pulseaudio modules, could fail ("internal" pulseaudio device names are matched against entries in the configuration). fixes #992
This commit is contained in:
parent
8583b5123e
commit
b42323013d
2 changed files with 14 additions and 3 deletions
|
@ -113,6 +113,12 @@ def test_missing_parameter():
|
|||
assert cfg.get("test.key") == None
|
||||
assert cfg.get("test.key", "no-value-set") == "no-value-set"
|
||||
|
||||
def test_file_case_sensitivity():
|
||||
cfg = core.config.Config([])
|
||||
cfg.load_config("", content="[module-parameters]\ntest.key = VaLuE\ntest.KeY2 = value")
|
||||
|
||||
assert cfg.get("test.key") == "VaLuE"
|
||||
assert cfg.get("test.KeY2") == "value"
|
||||
|
||||
#
|
||||
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue