mirror of https://github.com/progval/irctest.git
getMessages: Raise an error when forgetting to synchronize=False
Instead of hanging forever. Hopefully there shouldn't be any false positive.
This commit is contained in:
parent
cc8b9748a7
commit
b3d775f0d6
|
@ -88,6 +88,14 @@ class ClientMock:
|
||||||
message = message_parser.parse_message(line)
|
message = message_parser.parse_message(line)
|
||||||
if message.command == "PONG" and token in message.params:
|
if message.command == "PONG" and token in message.params:
|
||||||
got_pong = True
|
got_pong = True
|
||||||
|
elif (
|
||||||
|
synchronize
|
||||||
|
and message.command == "451"
|
||||||
|
and message.params[1] == "PING"
|
||||||
|
):
|
||||||
|
raise ValueError(
|
||||||
|
"Got '451 * PONG'. Did you forget synchronize=False?"
|
||||||
|
)
|
||||||
else:
|
else:
|
||||||
if raw:
|
if raw:
|
||||||
messages.append(line) # type: ignore
|
messages.append(line) # type: ignore
|
||||||
|
|
Loading…
Reference in New Issue