summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAndrei Zeliankou <zelenkov@nginx.com>2020-10-05 11:05:19 +0100
committerAndrei Zeliankou <zelenkov@nginx.com>2020-10-05 11:05:19 +0100
commit58cc73994f071fc5db3347a3956f8089cb8e4dd0 (patch)
tree79966e1ee959943003ecb372c60bec945ff031e8
parent152ad526f491e70905e2fec3b7d33a89cf23813b (diff)
downloadunit-58cc73994f071fc5db3347a3956f8089cb8e4dd0.tar.gz
unit-58cc73994f071fc5db3347a3956f8089cb8e4dd0.tar.bz2
Tests: added websocket test with long length.
Diffstat (limited to '')
-rw-r--r--test/test_asgi_websockets.py12
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')