Skip to content

Commit

Permalink
Add test for discarding string messages
Browse files Browse the repository at this point in the history
  • Loading branch information
lgrahl committed Jan 24, 2019
1 parent dc267cc commit 8f6edd5
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/test_protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,17 @@ async def test_invalid_path_symbols(self, url_factory, server, ws_client_factory
assert client.close_code == CloseCode.protocol_error
assert len(server.protocols) == 0

@pytest.mark.asyncio
async def test_invalid_message_str(self, server, ws_client_factory):
"""
The server must discard string messages.
"""
client = await ws_client_factory()
await client.send('m30w' * 10)
await server.wait_connections_closed()
assert not client.open
assert client.close_code == CloseCode.protocol_error

@pytest.mark.asyncio
async def test_server_hello(self, server, client_factory):
"""
Expand Down

0 comments on commit 8f6edd5

Please sign in to comment.