From 9e760a69a29f7ebc055c4adf6f81b0a4de6aba52 Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Tue, 29 Nov 2016 14:08:58 +0100 Subject: [PATCH] test_get_(cache|keys)_dir: clean env state, fixes #1897 make sure the BORG_(CACHE|KEYS)_DIR env var is not set initially. --- borg/testsuite/helpers.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/borg/testsuite/helpers.py b/borg/testsuite/helpers.py index 1087b552d..d0fa86b6b 100644 --- a/borg/testsuite/helpers.py +++ b/borg/testsuite/helpers.py @@ -627,6 +627,7 @@ class TestParseTimestamp(BaseTestCase): def test_get_cache_dir(monkeypatch): """test that get_cache_dir respects environment""" + monkeypatch.delenv('BORG_CACHE_DIR', raising=False) monkeypatch.delenv('XDG_CACHE_HOME', raising=False) assert get_cache_dir() == os.path.join(os.path.expanduser('~'), '.cache', 'borg') monkeypatch.setenv('XDG_CACHE_HOME', '/var/tmp/.cache') @@ -637,6 +638,7 @@ def test_get_cache_dir(monkeypatch): def test_get_keys_dir(monkeypatch): """test that get_keys_dir respects environment""" + monkeypatch.delenv('BORG_KEYS_DIR', raising=False) monkeypatch.delenv('XDG_CONFIG_HOME', raising=False) assert get_keys_dir() == os.path.join(os.path.expanduser('~'), '.config', 'borg', 'keys') monkeypatch.setenv('XDG_CONFIG_HOME', '/var/tmp/.config')