Lines Matching refs:frame

36     def check_close(self, sock, code=1000, no_close=False, frame=None):  argument
37 if frame == None:
38 frame = self.ws.frame_read(sock)
40 assert frame['fin'] == True, 'close fin'
41 assert frame['opcode'] == self.ws.OP_CLOSE, 'close opcode'
42 assert frame['code'] == code, 'close code'
47 def check_frame(self, frame, fin, opcode, payload, decode=True): argument
49 data = frame['data']
51 data = frame['data'].decode('utf-8')
53 assert frame['fin'] == fin, 'fin'
54 assert frame['opcode'] == opcode, 'opcode'
93 frame = self.ws.frame_read(sock)
95 assert message == frame['data'].decode('utf-8'), 'mirror'
98 frame = self.ws.frame_read(sock)
100 assert message == frame['data'].decode('utf-8'), 'mirror 2'
112 frame = self.ws.frame_read(sock)
114 assert message == frame['data'].decode('utf-8'), 'mirror'
119 frame = self.ws.frame_read(sock)
121 assert message == frame['data'].decode('utf-8'), 'mirror 2'
134 frame = self.ws.frame_read(sock)
136 assert frame['opcode'] == self.ws.OP_CLOSE, 'no mask opcode'
137 assert frame['code'] == 1002, 'no mask close code'
152 frame = self.ws.frame_read(sock)
154 assert message + ' ' + message == frame['data'].decode(
181 frame = self.ws.frame_read(sock)
183 frame.pop('data')
184 assert frame == {
206 frame = self.ws.frame_read(sock)
207 data = frame['data'].decode('utf-8')
209 frame = self.ws.frame_read(sock)
210 data += frame['data'].decode('utf-8')
426 frame = self.ws.frame_read(sock)
427 self.check_frame(frame, True, opcode, payload)
451 frame = self.ws.frame_read(sock)
453 self.check_frame(frame, True, opcode, payload)
476 frame = self.ws.frame_read(sock)
478 self.check_frame(frame, True, op_pong, payload, decode=decode)
517 frame = self.ws.frame_read(sock)
518 self.check_frame(frame, True, self.ws.OP_PONG, payload)
533 frame = self.ws.frame_read(sock)
534 self.check_frame(frame, True, self.ws.OP_PONG, 'payload-%d' % i)
543 frame = self.ws.frame_read(sock)
544 self.check_frame(frame, True, self.ws.OP_PONG, 'payload-%d' % i)
569 frame = self.ws.frame_read(sock)
570 self.check_frame(frame, True, self.ws.OP_TEXT, payload)
583 frame = self.ws.frame_read(sock)
584 self.check_frame(frame, True, self.ws.OP_TEXT, payload)
605 frame = self.ws.frame_read(sock)
606 self.check_frame(frame, True, self.ws.OP_TEXT, payload)
672 frame = self.ws.frame_read(sock)
673 self.check_frame(frame, True, self.ws.OP_TEXT, payload)
686 frame = self.ws.frame_read(sock)
687 self.check_frame(frame, True, self.ws.OP_TEXT, payload)
700 frame = self.ws.frame_read(sock)
701 self.check_frame(frame, True, self.ws.OP_TEXT, payload)
728 frame = self.ws.frame_read(sock)
729 self.check_frame(frame, True, self.ws.OP_TEXT, payload)
742 frame = self.ws.frame_read(sock)
743 self.check_frame(frame, True, self.ws.OP_TEXT, payload)
756 frame = self.ws.frame_read(sock)
757 self.check_frame(frame, True, self.ws.OP_TEXT, payload)
790 frame = self.ws.frame_read(sock)
791 self.check_frame(frame, True, self.ws.OP_TEXT, 'fragment1fragment2')
799 frame = self.ws.frame_read(sock)
800 self.check_frame(frame, True, self.ws.OP_TEXT, 'fragment1fragment2')
811 frame = self.ws.frame_read(sock)
812 self.check_frame(frame, True, self.ws.OP_TEXT, 'fragment1fragment2')
822 frame = self.ws.frame_read(sock)
823 self.check_frame(frame, True, self.ws.OP_PONG, ping_payload)
825 frame = self.ws.frame_read(sock)
826 self.check_frame(frame, True, self.ws.OP_TEXT, 'fragment1fragment2')
837 frame = self.ws.frame_read(sock)
838 self.check_frame(frame, True, self.ws.OP_PONG, ping_payload)
842 frame = self.ws.frame_read(sock)
843 self.check_frame(frame, True, self.ws.OP_TEXT, 'fragment1fragment2')
857 frame = self.ws.frame_read(sock)
858 self.check_frame(frame, True, self.ws.OP_PONG, ping_payload)
860 frame = self.ws.frame_read(sock)
861 self.check_frame(frame, True, self.ws.OP_TEXT, 'fragment1fragment2')
942 frame = self.ws.frame_read(sock)
944 if frame['opcode'] == self.ws.OP_TEXT:
945 self.check_frame(frame, True, self.ws.OP_TEXT, 'fragment1fragment2')
946 frame = None
948 self.check_close(sock, 1002, frame=frame)
993 frame = self.ws.frame_read(sock)
994 self.check_frame(frame, True, self.ws.OP_PONG, 'pongme 1!')
996 frame = self.ws.frame_read(sock)
997 self.check_frame(frame, True, self.ws.OP_PONG, 'pongme 2!')
1012 frame = self.ws.frame_read(sock)
1013 self.check_frame(frame, True, self.ws.OP_PONG, 'pongme 1!')
1021 frame = self.ws.frame_read(sock)
1022 self.check_frame(frame, True, self.ws.OP_PONG, 'pongme 2!')
1044 frame = self.ws.frame_read(sock)
1045 self.check_frame(frame, True, self.ws.OP_TEXT, '')
1053 frame = self.ws.frame_read(sock)
1054 self.check_frame(frame, True, self.ws.OP_TEXT, '')
1064 frame = self.ws.frame_read(sock)
1065 self.check_frame(frame, True, self.ws.OP_TEXT, payload)
1073 frame = self.ws.frame_read(sock)
1074 self.check_frame(frame, True, self.ws.OP_TEXT, payload)
1081 frame = self.ws.frame_read(sock)
1082 self.check_frame(frame, True, self.ws.OP_TEXT, payload)
1088 frame = self.ws.frame_read(sock)
1089 self.check_frame(frame, True, self.ws.OP_TEXT, payload)
1097 frame = self.ws.frame_read(sock)
1098 self.check_frame(frame, True, self.ws.OP_TEXT, payload)
1135 frame = self.ws.frame_read(sock)
1136 self.check_frame(frame, True, self.ws.OP_TEXT, payload)
1347 frame = self.ws.frame_read(sock, read_timeout=5)
1348 self.check_frame(frame, True, opcode, payload)
1357 frame = self.ws.frame_read(sock, read_timeout=5)
1358 self.check_frame(frame, True, opcode, payload)
1420 frame = self.ws.frame_read(sock)
1421 self.check_frame(frame, True, self.ws.OP_TEXT, payload)
1441 frame = self.ws.frame_read(sock)
1442 self.check_frame(frame, True, opcode, payload)
1458 frame = self.ws.frame_to_send(self.ws.OP_TEXT, 'blah')
1459 sock.sendall(frame[:2])
1474 frame = self.ws.frame_to_send(self.ws.OP_TEXT, 'blah')
1475 sock.sendall(frame[:2])
1479 frame = self.ws.frame_read(sock)
1480 self.check_frame(frame, True, self.ws.OP_PING, '') # PING frame
1495 frame = self.ws.frame_read(sock)
1497 assert message == frame['data'].decode('utf-8'), 'client'