1
0
Fork 0
mirror of https://github.com/borgbackup/borg.git synced 2025-02-25 23:43:49 +00:00

get_cache_dir: legacy=False default

This commit is contained in:
Thomas Waldmann 2023-02-04 00:03:23 +01:00
parent 424be763b2
commit ebcda6f0a5
No known key found for this signature in database
GPG key ID: 243ACFA951F78E01
2 changed files with 7 additions and 4 deletions

View file

@ -93,7 +93,7 @@ def get_security_dir(repository_id=None, *, legacy=True):
return security_dir
def get_cache_dir(*, legacy=True):
def get_cache_dir(*, legacy=False):
"""Determine where to repository keys and cache"""
if legacy:

View file

@ -646,9 +646,12 @@ def test_get_cache_dir(monkeypatch):
monkeypatch.delenv("BORG_BASE_DIR", raising=False)
if is_win32:
monkeypatch.delenv("BORG_CACHE_DIR", raising=False)
assert get_cache_dir(legacy=False) == os.path.join(
os.path.expanduser("~"), "AppData", "Local", "borg", "borg", "Cache"
)
assert get_cache_dir() == os.path.join(os.path.expanduser("~"), "AppData", "Local", "borg", "borg", "Cache")
elif is_darwin:
monkeypatch.delenv("BORG_CACHE_DIR", raising=False)
assert get_cache_dir() == os.path.join(os.path.expanduser("~"), "Library", "Caches", "borg")
monkeypatch.setenv("BORG_CACHE_DIR", "/var/tmp")
assert get_cache_dir() == "/var/tmp"
else:
monkeypatch.delenv("XDG_CACHE_HOME", raising=False)
monkeypatch.delenv("BORG_CACHE_DIR", raising=False)