Переглянути джерело

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()
                 extracted_data = f.read()
         assert extracted_data == data
         assert extracted_data == data
 
 
+    @pytest.mark.skipif(not are_symlinks_supported(), reason="symlinks not supported")
     def test_create_read_special_broken_symlink(self):
     def test_create_read_special_broken_symlink(self):
         os.symlink("somewhere does not exist", os.path.join(self.input_path, "link"))
         os.symlink("somewhere does not exist", os.path.join(self.input_path, "link"))
         self.cmd(f"--repo={self.repository_location}", "rcreate", RK_ENCRYPTION)
         self.cmd(f"--repo={self.repository_location}", "rcreate", RK_ENCRYPTION)