From 5f674b55ae090f91896ef57d05fb1337746253d7 Mon Sep 17 00:00:00 2001 From: ulif <uli@gnufix.de> Date: Mon, 9 May 2016 16:37:51 +0200 Subject: [PATCH] Add test: check `path_list` arg properly. The `diceware.config.get_config_dict()` argument `path_list` was not properly tested yet. Fix that. --- tests/test_config.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/test_config.py b/tests/test_config.py index a0a043e..31888cd 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -67,6 +67,16 @@ class TestGetConfigDict(object): assert len(conf_dict) == len(OPTIONS_DEFAULTS) assert conf_dict != OPTIONS_DEFAULTS + def test_get_config_dict_arg_path_list(self, home_dir): + # we can give the paths searched. + config_file_default = home_dir / ".diceware.ini" + config_file_default.write("[diceware]\nnum=4\n") + config_file_custom = home_dir / "some-new-file" + config_file_custom.write("[diceware]\nnum=42\n") + conf_dict = get_config_dict( + path_list = [str(config_file_custom), ]) + assert conf_dict['num'] == 42 + def test_get_config_dict_arg_defaults_dict(self, home_dir): # we can change the dict of defaults used. custom_defaults = dict(num=42) -- GitLab