mirror of
https://github.com/borgbackup/borg.git
synced 2024-12-27 02:08:54 +00:00
fix tests for new xattr exception handler, see #5583
This commit is contained in:
parent
d986114e5e
commit
2dbdaebd8a
1 changed files with 3 additions and 3 deletions
|
@ -1370,15 +1370,15 @@ def patched_setxattr_EACCES(*args, **kwargs):
|
||||||
input_abspath = os.path.abspath('input/file')
|
input_abspath = os.path.abspath('input/file')
|
||||||
with patch.object(xattr, 'setxattr', patched_setxattr_E2BIG):
|
with patch.object(xattr, 'setxattr', patched_setxattr_E2BIG):
|
||||||
out = self.cmd('extract', self.repository_location + '::test', exit_code=EXIT_WARNING)
|
out = self.cmd('extract', self.repository_location + '::test', exit_code=EXIT_WARNING)
|
||||||
assert '>: Value or key of extended attribute user.attribute is too big for this filesystem\n' in out
|
assert ': when setting extended attribute user.attribute: too big for this filesystem\n' in out
|
||||||
os.remove(input_abspath)
|
os.remove(input_abspath)
|
||||||
with patch.object(xattr, 'setxattr', patched_setxattr_ENOTSUP):
|
with patch.object(xattr, 'setxattr', patched_setxattr_ENOTSUP):
|
||||||
out = self.cmd('extract', self.repository_location + '::test', exit_code=EXIT_WARNING)
|
out = self.cmd('extract', self.repository_location + '::test', exit_code=EXIT_WARNING)
|
||||||
assert '>: Extended attributes are not supported on this filesystem\n' in out
|
assert ': when setting extended attribute user.attribute: xattrs not supported on this filesystem\n' in out
|
||||||
os.remove(input_abspath)
|
os.remove(input_abspath)
|
||||||
with patch.object(xattr, 'setxattr', patched_setxattr_EACCES):
|
with patch.object(xattr, 'setxattr', patched_setxattr_EACCES):
|
||||||
out = self.cmd('extract', self.repository_location + '::test', exit_code=EXIT_WARNING)
|
out = self.cmd('extract', self.repository_location + '::test', exit_code=EXIT_WARNING)
|
||||||
assert '>: Permission denied when setting extended attribute user.attribute\n' in out
|
assert ': when setting extended attribute user.attribute: Permission denied\n' in out
|
||||||
assert os.path.isfile(input_abspath)
|
assert os.path.isfile(input_abspath)
|
||||||
|
|
||||||
def test_path_normalization(self):
|
def test_path_normalization(self):
|
||||||
|
|
Loading…
Reference in a new issue