Changeset - 18800b249d2c
[Not reviewed]
0 2 0
Brett Smith - 4 years ago 2020-05-17 18:52:23
brettcsmith@brettcsmith.org
config: Let user specify books dir with ~.
2 files changed with 6 insertions and 1 deletions:
0 comments (0 inline, 0 general)
conservancy_beancount/config.py
Show inline comments
...
 
@@ -122,3 +122,3 @@ class Config:
 
        try:
 
            retval = Path(self.file_config['Beancount'].get('books dir'))
 
            retval = Path(self.file_config['Beancount']['books dir']).expanduser()
 
        except (KeyError, ValueError):
tests/test_config.py
Show inline comments
...
 
@@ -356,2 +356,7 @@ def test_no_books_path():
 

	
 
def test_books_path_expands_user():
 
    config = config_mod.Config()
 
    config.load_string('[Beancount]\nbooks dir = ~/userbooks\n')
 
    assert config.books_path() == (Path.home() / 'userbooks')
 

	
 
@pytest.mark.parametrize('value,month,day', [
0 comments (0 inline, 0 general)