Skip to content

Commit 8f6edd5

Browse files
committed
Add test for discarding string messages
1 parent dc267cc commit 8f6edd5

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tests/test_protocol.py

+11
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,17 @@ async def test_invalid_path_symbols(self, url_factory, server, ws_client_factory
8383
assert client.close_code == CloseCode.protocol_error
8484
assert len(server.protocols) == 0
8585

86+
@pytest.mark.asyncio
87+
async def test_invalid_message_str(self, server, ws_client_factory):
88+
"""
89+
The server must discard string messages.
90+
"""
91+
client = await ws_client_factory()
92+
await client.send('m30w' * 10)
93+
await server.wait_connections_closed()
94+
assert not client.open
95+
assert client.close_code == CloseCode.protocol_error
96+
8697
@pytest.mark.asyncio
8798
async def test_server_hello(self, server, client_factory):
8899
"""

0 commit comments

Comments
 (0)