浏览代码

testsuite: archiver: check if symlinks supported before test_create_read_special_broken_symlink

On Windows, symlinks can only be created by administrator accounts.
Using are_symlinks_supported() skips the test if the symlink cannot be created.
See https://docs.python.org/3/library/os.html#os.symlink
Rayyan Ansari 2 年之前
父节点
当前提交
2505118fff
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      src/borg/testsuite/archiver/create_cmd.py

+ 1 - 0
src/borg/testsuite/archiver/create_cmd.py

@@ -756,6 +756,7 @@ class ArchiverTestCase(ArchiverTestCaseBase):
                 extracted_data = f.read()
         assert extracted_data == data
 
+    @pytest.mark.skipif(not are_symlinks_supported(), reason="symlinks not supported")
     def test_create_read_special_broken_symlink(self):
         os.symlink("somewhere does not exist", os.path.join(self.input_path, "link"))
         self.cmd(f"--repo={self.repository_location}", "rcreate", RK_ENCRYPTION)