mirror of
https://github.com/borgbackup/borg.git
synced 2025-02-21 21:57:36 +00:00
test_get_(cache|keys)_dir: clean env state, fixes #1897
make sure the BORG_(CACHE|KEYS)_DIR env var is not set initially.
This commit is contained in:
parent
619cb123e5
commit
9e760a69a2
1 changed files with 2 additions and 0 deletions
|
@ -627,6 +627,7 @@ def test(self):
|
||||||
|
|
||||||
def test_get_cache_dir(monkeypatch):
|
def test_get_cache_dir(monkeypatch):
|
||||||
"""test that get_cache_dir respects environment"""
|
"""test that get_cache_dir respects environment"""
|
||||||
|
monkeypatch.delenv('BORG_CACHE_DIR', raising=False)
|
||||||
monkeypatch.delenv('XDG_CACHE_HOME', raising=False)
|
monkeypatch.delenv('XDG_CACHE_HOME', raising=False)
|
||||||
assert get_cache_dir() == os.path.join(os.path.expanduser('~'), '.cache', 'borg')
|
assert get_cache_dir() == os.path.join(os.path.expanduser('~'), '.cache', 'borg')
|
||||||
monkeypatch.setenv('XDG_CACHE_HOME', '/var/tmp/.cache')
|
monkeypatch.setenv('XDG_CACHE_HOME', '/var/tmp/.cache')
|
||||||
|
@ -637,6 +638,7 @@ def test_get_cache_dir(monkeypatch):
|
||||||
|
|
||||||
def test_get_keys_dir(monkeypatch):
|
def test_get_keys_dir(monkeypatch):
|
||||||
"""test that get_keys_dir respects environment"""
|
"""test that get_keys_dir respects environment"""
|
||||||
|
monkeypatch.delenv('BORG_KEYS_DIR', raising=False)
|
||||||
monkeypatch.delenv('XDG_CONFIG_HOME', raising=False)
|
monkeypatch.delenv('XDG_CONFIG_HOME', raising=False)
|
||||||
assert get_keys_dir() == os.path.join(os.path.expanduser('~'), '.config', 'borg', 'keys')
|
assert get_keys_dir() == os.path.join(os.path.expanduser('~'), '.config', 'borg', 'keys')
|
||||||
monkeypatch.setenv('XDG_CONFIG_HOME', '/var/tmp/.config')
|
monkeypatch.setenv('XDG_CONFIG_HOME', '/var/tmp/.config')
|
||||||
|
|
Loading…
Reference in a new issue