diff options
author | Andrei Zeliankou <zelenkov@nginx.com> | 2020-10-05 11:05:19 +0100 |
---|---|---|
committer | Andrei Zeliankou <zelenkov@nginx.com> | 2020-10-05 11:05:19 +0100 |
commit | 58cc73994f071fc5db3347a3956f8089cb8e4dd0 (patch) | |
tree | 79966e1ee959943003ecb372c60bec945ff031e8 /test | |
parent | 152ad526f491e70905e2fec3b7d33a89cf23813b (diff) | |
download | unit-58cc73994f071fc5db3347a3956f8089cb8e4dd0.tar.gz unit-58cc73994f071fc5db3347a3956f8089cb8e4dd0.tar.bz2 |
Tests: added websocket test with long length.
Diffstat (limited to 'test')
-rw-r--r-- | test/test_asgi_websockets.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/test_asgi_websockets.py b/test/test_asgi_websockets.py index 249f630f..cbd77109 100644 --- a/test/test_asgi_websockets.py +++ b/test/test_asgi_websockets.py @@ -128,6 +128,18 @@ class TestASGIWebsockets(TestApplicationPython): sock.close() + def test_asgi_websockets_length_long(self): + self.load('websockets/mirror') + + _, sock, _ = self.ws.upgrade() + + self.ws.frame_write(sock, self.ws.OP_TEXT, 'fragment1', fin=False) + self.ws.frame_write( + sock, self.ws.OP_CONT, 'fragment2', length=2**64 - 1 + ) + + self.check_close(sock, 1009) # 1009 - CLOSE_TOO_LARGE + def test_asgi_websockets_frame_fragmentation_invalid(self): self.load('websockets/mirror') |