From: Christian Heller Date: Thu, 27 Nov 2025 22:47:26 +0000 (+0100) Subject: Add SIGWINCH testing capability. X-Git-Url: https://plomlompom.com/repos/%7B%7Bprefix%7D%7D/%7B%7Bdb.prefix%7D%7D/calendar?a=commitdiff_plain;h=0256aee0a9d7a255e7b5bbc4ab7e1ccc4a17605a;p=ircplom Add SIGWINCH testing capability. --- 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')