Address code review: use < 2 condition, fix docstring, assert first handle = 2

Agent-Logs-Url: https://github.com/kovidgoyal/kitty/sessions/6973699c-a979-4d97-8213-1a4a501044a1

Co-authored-by: kovidgoyal <1308621+kovidgoyal@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-04-10 07:39:40 +00:00
committed by GitHub
parent afa63ccec7
commit b8cbb7f68d
2 changed files with 5 additions and 2 deletions

View File

@@ -753,7 +753,7 @@ class TestDnDProtocol(BaseTest):
self.ae(events[0]['payload'].strip(), b'EINVAL')
def test_uri_directory_transfer_tree(self) -> None:
"""Full directory tree ( 3 levels deep) transfer: listing, sub-dirs, file integrity.
"""Full directory tree (>= 3 levels deep) transfer: listing, sub-dirs, file integrity.
Also verifies that every response from the terminal unambiguously
identifies the filesystem object it refers to. For sub-directory
@@ -2014,6 +2014,9 @@ class TestDnDProtocol(BaseTest):
self.ae(ev['meta'].get('y'), '1')
handle = dir_handle(ev)
self.assertGreater(handle, 1, 'X= must be a directory handle (> 1)')
# In a fresh window the handle counter starts at 1, so the
# first allocated handle must be exactly 2.
self.ae(handle, 2, 'first allocated directory handle must be 2')
self.assertIsNone(ev['meta'].get('Y'),
'Y= must not be present in top-level dir response')