From 049523b03f5cdf424a40119b636f6069d4a638f3 Mon Sep 17 00:00:00 2001 From: Luna Date: Fri, 28 Jan 2022 23:38:12 -0300 Subject: [PATCH] tests: assert we are in a good state on autoreply --- tests/test_websocket.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/test_websocket.py b/tests/test_websocket.py index 6cb0d58..f436c43 100644 --- a/tests/test_websocket.py +++ b/tests/test_websocket.py @@ -28,6 +28,7 @@ import pytest import websockets from logbook import Logger from wsproto import WSConnection, ConnectionType +from wsproto.connection import ConnectionState from wsproto.events import ( Request, Message, @@ -132,6 +133,7 @@ class AsyncWebsocket: break if isinstance(event, CloseConnection): + assert self.ws.state is ConnectionState.REMOTE_CLOSING await self.send(event.response()) if process_event: raise websockets.ConnectionClosed(