Skip to content

Commit

Permalink
Tweak test
Browse files Browse the repository at this point in the history
  • Loading branch information
Neil Booth committed Feb 8, 2019
1 parent c58e6f2 commit 0dfc0f8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/test_session.py
Expand Up @@ -709,10 +709,14 @@ async def test_oversized_message(self, msg_server, caplog):
msg_server.port) as client:
big = 1024 * 1024
await client.send_message((b'version', bytes(big)))
# Give the receiving task time to process before closing the connection
await sleep(0.001)
assert not in_caplog(caplog, 'oversized payload')
async with Connector(MessageSession, 'localhost',
msg_server.port) as client:
await client.send_message((b'version', bytes(big + 1)))
# Give the receiving task time to process before closing the connection
await sleep(0.001)
assert in_caplog(caplog, 'oversized payload')

@pytest.mark.asyncio
Expand Down

0 comments on commit 0dfc0f8

Please sign in to comment.