From 65e5cecc53fd3015e25010b6917aea00552c2d73 Mon Sep 17 00:00:00 2001 From: Christian Heller Date: Thu, 2 Oct 2025 23:01:13 +0200 Subject: [PATCH] To tests, add wait/sleep directive. --- src/ircplom/testing.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/ircplom/testing.py b/src/ircplom/testing.py index 7e9a0a3..baf8060 100644 --- a/src/ircplom/testing.py +++ b/src/ircplom/testing.py @@ -2,7 +2,7 @@ from contextlib import contextmanager from queue import SimpleQueue, Empty as QueueEmpty from pathlib import Path -#from time import sleep +from time import sleep from typing import Callable, Generator, Iterator, Optional from ircplom.events import Event, Loop, QueueMixin from ircplom.client import IrcConnection, IrcConnSetup @@ -114,6 +114,7 @@ _CHAR_RANGE = ':' _CHAR_RANGE_DATA_SEP = ' ' _CHAR_WIN_ID_SEP = ',' _TOK_REPEAT = 'repeat' +_TOK_WAIT = 'wait' class _Playbook: @@ -204,6 +205,9 @@ class _Playbook: client = self._get_client(int(context[1:])) assert isinstance(client.conn, _FakeIrcConnection), client.conn client.conn.put_server_msg(msg) + elif context == _TOK_WAIT: + assert msg.isdigit() + sleep(int(msg)) else: break self._idx += 1 -- 2.30.2