From: Christian Heller Date: Wed, 15 Oct 2025 02:07:14 +0000 (+0200) Subject: For testing, use ERR_STR_TIMEOUT rather than 'FAKE_IRC_CONN_TIMEOUT_EXCEPTION'. X-Git-Url: https://plomlompom.com/repos/%7B%7B%20web_path%20%7D%7D/static/do_day?a=commitdiff_plain;h=3ba1c802f4aeb0edb2fd91e1aacae06637f76c06;p=ircplom For testing, use ERR_STR_TIMEOUT rather than 'FAKE_IRC_CONN_TIMEOUT_EXCEPTION'. --- diff --git a/src/ircplom/testing.py b/src/ircplom/testing.py index b63a3ad..c0ffd2a 100644 --- a/src/ircplom/testing.py +++ b/src/ircplom/testing.py @@ -107,9 +107,9 @@ class _FakeIrcConnection(IrcConnection): except QueueEmpty: yield None continue - if msg == 'FAKE_IRC_CONN_TIMEOUT_EXCEPTION': + if msg == ERR_STR_TIMEOUT: yield self._on_handled_loop_exception( - IrcConnException(ERR_STR_TIMEOUT, abort=False)) + IrcConnException(msg, abort=False)) continue if msg == 'FAKE_IRC_CONN_ABORT_EXCEPTION': raise IrcConnException(msg, retry=True) diff --git a/src/tests/_timeout_retries.test b/src/tests/_timeout_retries.test index c2ceebf..981190f 100644 --- a/src/tests/_timeout_retries.test +++ b/src/tests/_timeout_retries.test @@ -54,9 +54,9 @@ | conn-full-out # test retry chain also started by in-connection timeout -<0 FAKE_IRC_CONN_TIMEOUT_EXCEPTION +<0 timeout 1 ..> PING :what's up? -<0 FAKE_IRC_CONN_TIMEOUT_EXCEPTION +<0 timeout 1 ..$ connection_state set to: [broken: no timely PONG from server] repeat isupport-clear-in isupport-clear-out 1 ..$ connection_state set to: [] diff --git a/src/tests/pingpong.test b/src/tests/pingpong.test index d29ec75..5f2d8c6 100644 --- a/src/tests/pingpong.test +++ b/src/tests/pingpong.test @@ -34,7 +34,7 @@ # ping on timeout, go on as normal if PONG received | full-timeout-in | trigger-ping-in -<0 FAKE_IRC_CONN_TIMEOUT_EXCEPTION +<0 timeout 1 ..> PING :what's up? | trigger-ping-out :0:1 ..< :*.?.net PONG *.?.net :what's up? @@ -43,7 +43,7 @@ # another timeout instead of pong? disconnect repeat trigger-ping-in trigger-ping-out -<0 FAKE_IRC_CONN_TIMEOUT_EXCEPTION +<0 timeout 1 ..$ connection_state set to: [broken: no timely PONG from server] repeat isupport-clear-in isupport-clear-out 1 ..$ connection_state set to: []