Do not change list value to csv string

Remove side effect from strip_deprecated_dir function.
For context, see code review.
This commit is contained in:
Sergey Golitsynskiy
2020-12-17 23:27:52 -05:00
parent 07784b70cd
commit a001f445ff
2 changed files with 5 additions and 1 deletions
+4
View File
@@ -295,6 +295,10 @@ class BaseAppConfiguration:
"to suppress this warning: %s", key, resolves_to, ignore, path
)
paths[i] = path[len(ignore):]
# return list or string, depending on type of `value`
if isinstance(value, list):
return paths
return ','.join(paths)
return value
+1 -1
View File
@@ -214,7 +214,7 @@ def test_kwargs_as_list_listify(mock_init, monkeypatch):
new_path4 = ['new1', 'new2']
config = BaseAppConfiguration(path4=new_path4)
assert config._raw_config['path4'] == 'new1,new2'
assert config._raw_config['path4'] == ['new1', 'new2']
assert config.path4 == ['my-config/new1', 'my-config/new2']