Lines Matching refs:frame

30     def check_close(self, sock, code=1000, no_close=False, frame=None):  argument
31 if frame == None:
32 frame = self.ws.frame_read(sock)
34 assert frame['fin'] == True, 'close fin'
35 assert frame['opcode'] == self.ws.OP_CLOSE, 'close opcode'
36 assert frame['code'] == code, 'close code'
41 def check_frame(self, frame, fin, opcode, payload, decode=True): argument
43 data = frame['data']
45 data = frame['data'].decode('utf-8')
47 assert frame['fin'] == fin, 'fin'
48 assert frame['opcode'] == opcode, 'opcode'
72 frame = self.ws.frame_read(sock)
74 assert message == frame['data'].decode('utf-8'), 'mirror'
77 frame = self.ws.frame_read(sock)
79 assert message == frame['data'].decode('utf-8'), 'mirror 2'
92 frame = self.ws.frame_read(sock)
94 assert frame['opcode'] == self.ws.OP_CLOSE, 'no mask opcode'
95 assert frame['code'] == 1002, 'no mask close code'
110 frame = self.ws.frame_read(sock)
112 assert message + ' ' + message == frame['data'].decode(
127 frame = self.ws.frame_read(sock)
129 frame.pop('data')
130 assert frame == {
353 frame = self.ws.message_read(sock)
354 self.check_frame(frame, True, opcode, payload)
379 frame = self.ws.message_read(sock)
380 self.check_frame(frame, True, opcode, payload)
403 frame = self.ws.frame_read(sock)
405 self.check_frame(frame, True, op_pong, payload, decode=decode)
444 frame = self.ws.frame_read(sock)
445 self.check_frame(frame, True, self.ws.OP_PONG, payload)
460 frame = self.ws.frame_read(sock)
461 self.check_frame(frame, True, self.ws.OP_PONG, 'payload-%d' % i)
470 frame = self.ws.frame_read(sock)
471 self.check_frame(frame, True, self.ws.OP_PONG, 'payload-%d' % i)
496 frame = self.ws.frame_read(sock)
497 self.check_frame(frame, True, self.ws.OP_TEXT, payload)
510 frame = self.ws.frame_read(sock)
511 self.check_frame(frame, True, self.ws.OP_TEXT, payload)
532 frame = self.ws.frame_read(sock)
533 self.check_frame(frame, True, self.ws.OP_TEXT, payload)
599 frame = self.ws.frame_read(sock)
600 self.check_frame(frame, True, self.ws.OP_TEXT, payload)
613 frame = self.ws.frame_read(sock)
614 self.check_frame(frame, True, self.ws.OP_TEXT, payload)
627 frame = self.ws.frame_read(sock)
628 self.check_frame(frame, True, self.ws.OP_TEXT, payload)
655 frame = self.ws.frame_read(sock)
656 self.check_frame(frame, True, self.ws.OP_TEXT, payload)
669 frame = self.ws.frame_read(sock)
670 self.check_frame(frame, True, self.ws.OP_TEXT, payload)
683 frame = self.ws.frame_read(sock)
684 self.check_frame(frame, True, self.ws.OP_TEXT, payload)
717 frame = self.ws.frame_read(sock)
718 self.check_frame(frame, True, self.ws.OP_TEXT, 'fragment1fragment2')
726 frame = self.ws.frame_read(sock)
727 self.check_frame(frame, True, self.ws.OP_TEXT, 'fragment1fragment2')
738 frame = self.ws.frame_read(sock)
739 self.check_frame(frame, True, self.ws.OP_TEXT, 'fragment1fragment2')
749 frame = self.ws.frame_read(sock)
750 self.check_frame(frame, True, self.ws.OP_PONG, ping_payload)
752 frame = self.ws.frame_read(sock)
753 self.check_frame(frame, True, self.ws.OP_TEXT, 'fragment1fragment2')
764 frame = self.ws.frame_read(sock)
765 self.check_frame(frame, True, self.ws.OP_PONG, ping_payload)
769 frame = self.ws.frame_read(sock)
770 self.check_frame(frame, True, self.ws.OP_TEXT, 'fragment1fragment2')
784 frame = self.ws.frame_read(sock)
785 self.check_frame(frame, True, self.ws.OP_PONG, ping_payload)
787 frame = self.ws.frame_read(sock)
788 self.check_frame(frame, True, self.ws.OP_TEXT, 'fragment1fragment2')
869 frame = self.ws.frame_read(sock)
871 if frame['opcode'] == self.ws.OP_TEXT:
872 self.check_frame(frame, True, self.ws.OP_TEXT, 'fragment1fragment2')
873 frame = None
875 self.check_close(sock, 1002, frame=frame)
920 frame = self.ws.frame_read(sock)
921 self.check_frame(frame, True, self.ws.OP_PONG, 'pongme 1!')
923 frame = self.ws.frame_read(sock)
924 self.check_frame(frame, True, self.ws.OP_PONG, 'pongme 2!')
939 frame = self.ws.frame_read(sock)
940 self.check_frame(frame, True, self.ws.OP_PONG, 'pongme 1!')
948 frame = self.ws.frame_read(sock)
949 self.check_frame(frame, True, self.ws.OP_PONG, 'pongme 2!')
971 frame = self.ws.frame_read(sock, read_timeout=3)
972 self.check_frame(frame, True, self.ws.OP_TEXT, '')
980 frame = self.ws.frame_read(sock, read_timeout=3)
981 self.check_frame(frame, True, self.ws.OP_TEXT, '')
991 frame = self.ws.frame_read(sock)
992 self.check_frame(frame, True, self.ws.OP_TEXT, payload)
1000 frame = self.ws.frame_read(sock)
1001 self.check_frame(frame, True, self.ws.OP_TEXT, payload)
1008 frame = self.ws.frame_read(sock)
1009 self.check_frame(frame, True, self.ws.OP_TEXT, payload)
1015 frame = self.ws.frame_read(sock)
1016 self.check_frame(frame, True, self.ws.OP_TEXT, payload)
1024 frame = self.ws.frame_read(sock)
1025 self.check_frame(frame, True, self.ws.OP_TEXT, payload)
1062 frame = self.ws.frame_read(sock)
1063 self.check_frame(frame, True, self.ws.OP_TEXT, payload)
1274 frame = self.ws.frame_read(sock)
1275 self.check_frame(frame, True, opcode, payload)
1284 frame = self.ws.frame_read(sock, read_timeout=5)
1285 self.check_frame(frame, True, opcode, payload)
1347 frame = self.ws.message_read(sock)
1348 self.check_frame(frame, True, self.ws.OP_TEXT, payload)
1368 frame = self.ws.frame_read(sock)
1369 self.check_frame(frame, True, opcode, payload)
1385 frame = self.ws.frame_to_send(self.ws.OP_TEXT, 'blah')
1386 sock.sendall(frame[:2])
1401 frame = self.ws.frame_to_send(self.ws.OP_TEXT, 'blah')
1402 sock.sendall(frame[:2])
1406 frame = self.ws.frame_read(sock)
1407 self.check_frame(frame, True, self.ws.OP_PING, '') # PING frame