diff --git a/kitty_tests/dnd.py b/kitty_tests/dnd.py index e79ad8ea1..07743c157 100644 --- a/kitty_tests/dnd.py +++ b/kitty_tests/dnd.py @@ -809,9 +809,11 @@ class TestDnDProtocol(BaseTest): """A broken symlink in the URI list is transmitted as a symlink (X=1) with the target.""" import os import tempfile + import uuid + does_not_exist = '/' + str(uuid.uuid4()) with tempfile.TemporaryDirectory() as root: broken_link = os.path.join(root, 'broken.txt') - os.symlink('/does-not-exist', broken_link) + os.symlink(does_not_exist, broken_link) uri_list = f'file://{broken_link}\r\n'.encode() with dnd_test_window() as (screen, cap): self._setup_uri_drop(screen, cap, uri_list) @@ -823,7 +825,7 @@ class TestDnDProtocol(BaseTest): self.assertEqual(r_events[0]['meta'].get('X'), '1', 'broken symlink response must have X=1') target = b''.join(e['payload'] for e in r_events if e['payload']) - self.ae(target, b'/does-not-exist') + self.ae(target, does_not_exist.encode()) def test_uri_non_broken_symlink_to_file_transmitted_as_file(self) -> None: """A non-broken symlink to a regular file is transmitted as the file content, not as a symlink.""" diff --git a/kitty_tests/dnd_kitten.py b/kitty_tests/dnd_kitten.py index 82e5b9f60..f50b26bee 100644 --- a/kitty_tests/dnd_kitten.py +++ b/kitty_tests/dnd_kitten.py @@ -5,6 +5,7 @@ import os import random import shutil import tempfile +import uuid from base64 import standard_b64encode from functools import partial from urllib.parse import unquote, urlparse @@ -42,7 +43,7 @@ def create_fs(base): f.write(b'x' * sz) os.makedirs(join('d1', 'sd', 'ssd')) os.mkdir(join('d2')) - os.symlink('/does-not-exist', join('s1')) + os.symlink('/' + str(uuid.uuid4()), join('s1')) os.symlink('d1', join('sd')) os.symlink('/', join('sr')) os.symlink('../d1', join('d1', 'sr'))