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 == {
152 frame = self.ws.frame_read(sock)
153 data = frame['data'].decode('utf-8')
155 frame = self.ws.frame_read(sock)
156 data += frame['data'].decode('utf-8')
372 frame = self.ws.frame_read(sock)
373 self.check_frame(frame, True, opcode, payload)
397 frame = self.ws.frame_read(sock)
399 self.check_frame(frame, True, opcode, payload)
422 frame = self.ws.frame_read(sock)
424 self.check_frame(frame, True, op_pong, payload, decode=decode)
463 frame = self.ws.frame_read(sock)
464 self.check_frame(frame, True, self.ws.OP_PONG, payload)
479 frame = self.ws.frame_read(sock)
480 self.check_frame(frame, True, self.ws.OP_PONG, 'payload-%d' % i)
489 frame = self.ws.frame_read(sock)
490 self.check_frame(frame, True, self.ws.OP_PONG, 'payload-%d' % i)
515 frame = self.ws.frame_read(sock)
516 self.check_frame(frame, True, self.ws.OP_TEXT, payload)
529 frame = self.ws.frame_read(sock)
530 self.check_frame(frame, True, self.ws.OP_TEXT, payload)
551 frame = self.ws.frame_read(sock)
552 self.check_frame(frame, True, self.ws.OP_TEXT, payload)
618 frame = self.ws.frame_read(sock)
619 self.check_frame(frame, True, self.ws.OP_TEXT, payload)
632 frame = self.ws.frame_read(sock)
633 self.check_frame(frame, True, self.ws.OP_TEXT, payload)
646 frame = self.ws.frame_read(sock)
647 self.check_frame(frame, True, self.ws.OP_TEXT, payload)
674 frame = self.ws.frame_read(sock)
675 self.check_frame(frame, True, self.ws.OP_TEXT, payload)
688 frame = self.ws.frame_read(sock)
689 self.check_frame(frame, True, self.ws.OP_TEXT, payload)
702 frame = self.ws.frame_read(sock)
703 self.check_frame(frame, True, self.ws.OP_TEXT, payload)
736 frame = self.ws.frame_read(sock)
737 self.check_frame(frame, True, self.ws.OP_TEXT, 'fragment1fragment2')
745 frame = self.ws.frame_read(sock)
746 self.check_frame(frame, True, self.ws.OP_TEXT, 'fragment1fragment2')
757 frame = self.ws.frame_read(sock)
758 self.check_frame(frame, True, self.ws.OP_TEXT, 'fragment1fragment2')
768 frame = self.ws.frame_read(sock)
769 self.check_frame(frame, True, self.ws.OP_PONG, ping_payload)
771 frame = self.ws.frame_read(sock)
772 self.check_frame(frame, True, self.ws.OP_TEXT, 'fragment1fragment2')
783 frame = self.ws.frame_read(sock)
784 self.check_frame(frame, True, self.ws.OP_PONG, ping_payload)
788 frame = self.ws.frame_read(sock)
789 self.check_frame(frame, True, self.ws.OP_TEXT, 'fragment1fragment2')
803 frame = self.ws.frame_read(sock)
804 self.check_frame(frame, True, self.ws.OP_PONG, ping_payload)
806 frame = self.ws.frame_read(sock)
807 self.check_frame(frame, True, self.ws.OP_TEXT, 'fragment1fragment2')
888 frame = self.ws.frame_read(sock)
890 if frame['opcode'] == self.ws.OP_TEXT:
891 self.check_frame(frame, True, self.ws.OP_TEXT, 'fragment1fragment2')
892 frame = None
894 self.check_close(sock, 1002, frame=frame)
939 frame = self.ws.frame_read(sock)
940 self.check_frame(frame, True, self.ws.OP_PONG, 'pongme 1!')
942 frame = self.ws.frame_read(sock)
943 self.check_frame(frame, True, self.ws.OP_PONG, 'pongme 2!')
958 frame = self.ws.frame_read(sock)
959 self.check_frame(frame, True, self.ws.OP_PONG, 'pongme 1!')
967 frame = self.ws.frame_read(sock)
968 self.check_frame(frame, True, self.ws.OP_PONG, 'pongme 2!')
990 frame = self.ws.frame_read(sock)
991 self.check_frame(frame, True, self.ws.OP_TEXT, '')
999 frame = self.ws.frame_read(sock)
1000 self.check_frame(frame, True, self.ws.OP_TEXT, '')
1010 frame = self.ws.frame_read(sock)
1011 self.check_frame(frame, True, self.ws.OP_TEXT, payload)
1019 frame = self.ws.frame_read(sock)
1020 self.check_frame(frame, True, self.ws.OP_TEXT, payload)
1027 frame = self.ws.frame_read(sock)
1028 self.check_frame(frame, True, self.ws.OP_TEXT, payload)
1034 frame = self.ws.frame_read(sock)
1035 self.check_frame(frame, True, self.ws.OP_TEXT, payload)
1043 frame = self.ws.frame_read(sock)
1044 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)
1293 frame = self.ws.frame_read(sock, read_timeout=5)
1294 self.check_frame(frame, True, opcode, payload)
1303 frame = self.ws.frame_read(sock, read_timeout=5)
1304 self.check_frame(frame, True, opcode, payload)
1366 frame = self.ws.frame_read(sock)
1367 self.check_frame(frame, True, self.ws.OP_TEXT, payload)
1387 frame = self.ws.frame_read(sock)
1388 self.check_frame(frame, True, opcode, payload)
1404 frame = self.ws.frame_to_send(self.ws.OP_TEXT, 'blah')
1405 sock.sendall(frame[:2])
1420 frame = self.ws.frame_to_send(self.ws.OP_TEXT, 'blah')
1421 sock.sendall(frame[:2])
1425 frame = self.ws.frame_read(sock)
1426 self.check_frame(frame, True, self.ws.OP_PING, '') # PING frame