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:
parent
424be763b2
commit
ebcda6f0a5
2 changed files with 7 additions and 4 deletions
|
@ -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:
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue