mirror of
https://github.com/borgbackup/borg.git
synced 2025-03-10 14:15:43 +00:00
platform tests: misc. minor cleanups
- remove unused global / import - use is_linux and is_darwin - rename darwin acl test method
This commit is contained in:
parent
926b5a6b08
commit
d870c58e61
1 changed files with 3 additions and 6 deletions
|
@ -1,7 +1,6 @@
|
||||||
import errno
|
import errno
|
||||||
import functools
|
import functools
|
||||||
import os
|
import os
|
||||||
import random
|
|
||||||
import shutil
|
import shutil
|
||||||
import sys
|
import sys
|
||||||
import tempfile
|
import tempfile
|
||||||
|
@ -36,8 +35,6 @@ mask::rw-
|
||||||
other::r--
|
other::r--
|
||||||
""".strip().encode('ascii')
|
""".strip().encode('ascii')
|
||||||
|
|
||||||
_acls_working = None
|
|
||||||
|
|
||||||
|
|
||||||
def fakeroot_detected():
|
def fakeroot_detected():
|
||||||
return 'FAKEROOTKEY' in os.environ
|
return 'FAKEROOTKEY' in os.environ
|
||||||
|
@ -82,7 +79,7 @@ def are_acls_working():
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
@unittest.skipUnless(sys.platform.startswith('linux'), 'linux only test')
|
@unittest.skipUnless(is_linux, 'linux only test')
|
||||||
@unittest.skipIf(fakeroot_detected(), 'not compatible with fakeroot')
|
@unittest.skipIf(fakeroot_detected(), 'not compatible with fakeroot')
|
||||||
class PlatformLinuxTestCase(BaseTestCase):
|
class PlatformLinuxTestCase(BaseTestCase):
|
||||||
|
|
||||||
|
@ -160,7 +157,7 @@ class PlatformLinuxTestCase(BaseTestCase):
|
||||||
self.assert_equal(acl_use_local_uid_gid(b'group:root:rw-:0'), b'group:0:rw-')
|
self.assert_equal(acl_use_local_uid_gid(b'group:root:rw-:0'), b'group:0:rw-')
|
||||||
|
|
||||||
|
|
||||||
@unittest.skipUnless(sys.platform.startswith('darwin'), 'macOS only test')
|
@unittest.skipUnless(is_darwin, 'macOS only test')
|
||||||
@unittest.skipIf(fakeroot_detected(), 'not compatible with fakeroot')
|
@unittest.skipIf(fakeroot_detected(), 'not compatible with fakeroot')
|
||||||
class PlatformDarwinTestCase(BaseTestCase):
|
class PlatformDarwinTestCase(BaseTestCase):
|
||||||
|
|
||||||
|
@ -180,7 +177,7 @@ class PlatformDarwinTestCase(BaseTestCase):
|
||||||
acl_set(path, item, numeric_ids=numeric_ids)
|
acl_set(path, item, numeric_ids=numeric_ids)
|
||||||
|
|
||||||
@unittest.skipIf(not are_acls_working(), 'ACLs do not work')
|
@unittest.skipIf(not are_acls_working(), 'ACLs do not work')
|
||||||
def test_access_acl(self):
|
def test_extended_acl(self):
|
||||||
file = tempfile.NamedTemporaryFile()
|
file = tempfile.NamedTemporaryFile()
|
||||||
file2 = tempfile.NamedTemporaryFile()
|
file2 = tempfile.NamedTemporaryFile()
|
||||||
self.assert_equal(self.get_acl(file.name), {})
|
self.assert_equal(self.get_acl(file.name), {})
|
||||||
|
|
Loading…
Add table
Reference in a new issue