Zero-byte payload is handled gracefully – only end signal is sent.
(self)
| 669 | self.ae(last['payload'], b'') |
| 670 | |
| 671 | def test_empty_data(self) -> None: |
| 672 | """Zero-byte payload is handled gracefully – only end signal is sent.""" |
| 673 | with dnd_test_window() as (screen, cap): |
| 674 | self._register_for_drops(screen, cap, 'text/plain') |
| 675 | dnd_test_set_mouse_pos(cap.window_id, 0, 0, 0, 0) |
| 676 | dnd_test_fake_drop_event(cap.window_id, True, ['text/plain']) |
| 677 | cap.consume() |
| 678 | |
| 679 | parse_bytes(screen, client_request_data(1)) |
| 680 | dnd_test_fake_drop_data(cap.window_id, 'text/plain', b'') |
| 681 | raw = cap.consume() |
| 682 | events = parse_escape_codes(raw) |
| 683 | r_events = [e for e in events if e['type'] == 'r'] |
| 684 | # Only the end signal should be present. |
| 685 | self.assertEqual(len(r_events), 1, raw) |
| 686 | self.ae(r_events[0]['payload'], b'') |
| 687 | |
| 688 | # ---- remote file/directory transfer tests ---------------- |
| 689 |
nothing calls this directly
no test coverage detected