diff --git a/tests/test_config.py b/tests/test_config.py index bb4625a2947d7cfbc41ab2655692359ebb0d5e43..0537d528f2672486ace2a27d0804dcf6abf2b640 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -86,6 +86,19 @@ def update_umask(mask): finally: os.umask(old_mask) +def test_repository_from_file(): + path_s = '/home/good' + with update_environ(CONSERVANCY_REPOSITORY='bad'): + config = config_mod.Config() + config.load_string(f"[Beancount]\nrepository dir = {path_s}\n") + assert config.repository_path() == Path(path_s) + +def test_repository_expands_user(): + path_s = 'tilderepo' + config = config_mod.Config() + config.load_string(f"[Beancount]\nrepository dir = ~/{path_s}\n") + assert config.repository_path() == Path.home() / path_s + def test_repository_from_environment(): config = config_mod.Config() assert config.repository_path() == testutil.test_path('repository')