mirror of https://gitlab.com/litecord/litecord.git
tests: assert we are in a good state on autoreply
This commit is contained in:
parent
38b560205f
commit
049523b03f
|
|
@ -28,6 +28,7 @@ import pytest
|
||||||
import websockets
|
import websockets
|
||||||
from logbook import Logger
|
from logbook import Logger
|
||||||
from wsproto import WSConnection, ConnectionType
|
from wsproto import WSConnection, ConnectionType
|
||||||
|
from wsproto.connection import ConnectionState
|
||||||
from wsproto.events import (
|
from wsproto.events import (
|
||||||
Request,
|
Request,
|
||||||
Message,
|
Message,
|
||||||
|
|
@ -132,6 +133,7 @@ class AsyncWebsocket:
|
||||||
break
|
break
|
||||||
|
|
||||||
if isinstance(event, CloseConnection):
|
if isinstance(event, CloseConnection):
|
||||||
|
assert self.ws.state is ConnectionState.REMOTE_CLOSING
|
||||||
await self.send(event.response())
|
await self.send(event.response())
|
||||||
if process_event:
|
if process_event:
|
||||||
raise websockets.ConnectionClosed(
|
raise websockets.ConnectionClosed(
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue