summaryrefslogtreecommitdiffhomepage
path: root/test/test_node_websockets.py
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--test/test_node_websockets.py14
1 files changed, 11 insertions, 3 deletions
diff --git a/test/test_node_websockets.py b/test/test_node_websockets.py
index 4f1e5906..d5f79811 100644
--- a/test/test_node_websockets.py
+++ b/test/test_node_websockets.py
@@ -27,8 +27,9 @@ class TestNodeWebsockets(TestApplicationNode):
self.check_close(sock)
- def check_close(self, sock, code=1000, no_close=False):
- frame = self.ws.frame_read(sock)
+ def check_close(self, sock, code=1000, no_close=False, frame=None):
+ if frame == None:
+ frame = self.ws.frame_read(sock)
assert frame['fin'] == True, 'close fin'
assert frame['opcode'] == self.ws.OP_CLOSE, 'close opcode'
@@ -881,7 +882,14 @@ class TestNodeWebsockets(TestApplicationNode):
self.ws.frame_write(sock, self.ws.OP_CONT, 'fragment2', fin=True)
self.ws.frame_write(sock, self.ws.OP_CONT, 'fragment3', fin=False)
self.ws.frame_write(sock, self.ws.OP_TEXT, 'fragment4', fin=True)
- self.check_close(sock, 1002)
+
+ frame = self.ws.frame_read(sock)
+
+ if frame['opcode'] == self.ws.OP_TEXT:
+ self.check_frame(frame, True, self.ws.OP_TEXT, 'fragment1fragment2')
+ frame = None
+
+ self.check_close(sock, 1002, frame=frame)
# 5_16