Merge pull request #56227 from bdrung/fix-symlink-test

Fix broken symlink in test_symlink_list
This commit is contained in:
Daniel Wozniak 2020-04-20 00:59:37 -07:00 committed by GitHub
commit 27ae826098
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -62,6 +62,12 @@ class RootsTest(TestCase, AdaptedConfigurationTestCaseMixin, LoaderModuleMockMix
os.chdir(cwd)
cls.test_symlink_list_file_roots = {"base": [root_dir]}
else:
dest_sym = os.path.join(RUNTIME_VARS.BASE_FILES, "dest_sym")
if not os.path.islink(dest_sym):
# Fix broken symlink by recreating it
if os.path.exists(dest_sym):
os.remove(dest_sym)
os.symlink("source_sym", dest_sym)
cls.test_symlink_list_file_roots = None
cls.tmp_dir = tempfile.mkdtemp(dir=RUNTIME_VARS.TMP)
full_path_to_file = os.path.join(RUNTIME_VARS.BASE_FILES, "testfile")