mirror of
https://github.com/borgbackup/borg.git
synced 2026-06-13 10:50:21 -04:00
fix xattr tests
while fixing #6988, some strings were changed, but the tests not adapted:
a758fda089
This commit is contained in:
parent
ab0f0d24fd
commit
ffd6d51b2c
1 changed files with 6 additions and 6 deletions
|
|
@ -1399,8 +1399,8 @@ class ArchiverTestCase(ArchiverTestCaseBase):
|
|||
def patched_setxattr_E2BIG(*args, **kwargs):
|
||||
raise OSError(errno.E2BIG, 'E2BIG')
|
||||
|
||||
def patched_setxattr_ENOTSUP(*args, **kwargs):
|
||||
raise OSError(errno.ENOTSUP, 'ENOTSUP')
|
||||
def patched_setxattr_ENOSPC(*args, **kwargs):
|
||||
raise OSError(errno.ENOSPC, 'ENOSPC')
|
||||
|
||||
def patched_setxattr_EACCES(*args, **kwargs):
|
||||
raise OSError(errno.EACCES, 'EACCES')
|
||||
|
|
@ -1413,15 +1413,15 @@ class ArchiverTestCase(ArchiverTestCaseBase):
|
|||
input_abspath = os.path.abspath('input/file')
|
||||
with patch.object(xattr, 'setxattr', patched_setxattr_E2BIG):
|
||||
out = self.cmd('extract', self.repository_location + '::test', exit_code=EXIT_WARNING)
|
||||
assert ': when setting extended attribute user.attribute: too big for this filesystem\n' in out
|
||||
assert 'when setting extended attribute user.attribute: too big for this filesystem' in out
|
||||
os.remove(input_abspath)
|
||||
with patch.object(xattr, 'setxattr', patched_setxattr_ENOTSUP):
|
||||
with patch.object(xattr, 'setxattr', patched_setxattr_ENOSPC):
|
||||
out = self.cmd('extract', self.repository_location + '::test', exit_code=EXIT_WARNING)
|
||||
assert ': when setting extended attribute user.attribute: xattrs not supported on this filesystem\n' in out
|
||||
assert 'when setting extended attribute user.attribute: fs full or xattr too big?' in out
|
||||
os.remove(input_abspath)
|
||||
with patch.object(xattr, 'setxattr', patched_setxattr_EACCES):
|
||||
out = self.cmd('extract', self.repository_location + '::test', exit_code=EXIT_WARNING)
|
||||
assert ': when setting extended attribute user.attribute: Permission denied\n' in out
|
||||
assert 'when setting extended attribute user.attribute:' in out
|
||||
assert os.path.isfile(input_abspath)
|
||||
|
||||
def test_path_normalization(self):
|
||||
|
|
|
|||
Loading…
Reference in a new issue