mirror of
https://github.com/borgbackup/borg.git
synced 2026-06-09 17:00:11 -04:00
cygwin: skip ~root base dir test
This commit is contained in:
parent
289364b7d7
commit
b1b9e781af
3 changed files with 7 additions and 4 deletions
|
|
@ -4,7 +4,7 @@ Platform-specific APIs.
|
|||
Public APIs are documented in platform.base.
|
||||
"""
|
||||
|
||||
from ..platformflags import is_win32, is_linux, is_freebsd, is_darwin
|
||||
from ..platformflags import is_win32, is_linux, is_freebsd, is_darwin, is_cygwin
|
||||
|
||||
from .base import listxattr, getxattr, setxattr, ENOATTR
|
||||
from .base import acl_get, acl_set
|
||||
|
|
|
|||
|
|
@ -7,6 +7,8 @@ Use these flags instead of sys.platform.startswith('<OS>') or try/except.
|
|||
import sys
|
||||
|
||||
is_win32 = sys.platform.startswith('win32')
|
||||
is_cygwin = sys.platform.startswith('cygwin')
|
||||
|
||||
is_linux = sys.platform.startswith('linux')
|
||||
is_freebsd = sys.platform.startswith('freebsd')
|
||||
is_netbsd = sys.platform.startswith('netbsd')
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ from ..helpers import dash_open
|
|||
from ..helpers import iter_separated
|
||||
from ..helpers import eval_escapes
|
||||
from ..helpers import classify_ec, max_ec
|
||||
from ..platform import is_win32, swidth
|
||||
from ..platform import is_win32, swidth, is_cygwin
|
||||
|
||||
from . import BaseTestCase, FakeInputs
|
||||
|
||||
|
|
@ -582,8 +582,9 @@ def test_get_base_dir(monkeypatch):
|
|||
monkeypatch.delenv('HOME', raising=False)
|
||||
monkeypatch.delenv('USER', raising=False)
|
||||
assert get_base_dir() == os.path.expanduser('~')
|
||||
monkeypatch.setenv('USER', 'root')
|
||||
assert get_base_dir() == os.path.expanduser('~root')
|
||||
if not is_cygwin:
|
||||
monkeypatch.setenv('USER', 'root')
|
||||
assert get_base_dir() == os.path.expanduser('~root')
|
||||
monkeypatch.setenv('HOME', '/var/tmp/home')
|
||||
assert get_base_dir() == '/var/tmp/home'
|
||||
monkeypatch.setenv('BORG_BASE_DIR', '/var/tmp/base')
|
||||
|
|
|
|||
Loading…
Reference in a new issue