From 0256aee0a9d7a255e7b5bbc4ab7e1ccc4a17605a Mon Sep 17 00:00:00 2001 From: Christian Heller Date: Thu, 27 Nov 2025 23:47:26 +0100 Subject: [PATCH] Add SIGWINCH testing capability. --- src/ircplom/testing.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/ircplom/testing.py b/src/ircplom/testing.py index a84e342..0199e52 100644 --- a/src/ircplom/testing.py +++ b/src/ircplom/testing.py @@ -1,9 +1,12 @@ 'Basic testing.' +# built-ins from contextlib import contextmanager from queue import SimpleQueue, Empty as QueueEmpty from pathlib import Path +from signal import raise_signal, SIGWINCH from time import sleep from typing import Callable, Generator, Iterator, Optional +# ourselves from ircplom.events import Event, Loop, QueueMixin from ircplom.client import IrcConnection, IrcConnSetup from ircplom.client_tui import ClientKnowingTui, ClientTui @@ -418,6 +421,10 @@ class _Playbook: cmd_name, args = self._line_log_and_parse(*self._current_line) if cmd_name == _MARK_PROMPT: assert self.put_keypress is not None + if args[0] == 'raise_sigwinch': + args = ('',) + self._lines_t[self._idx:self._idx + 1] = [('', '> ')] + raise_signal(SIGWINCH) for c in args[0]: self.put_keypress(c) self.put_keypress('KEY_ENTER') -- 2.30.2