def test_parse_frame_body_not_terminated(self): buff = io.BytesIO(b'CONNECT\ncontent-length:10\n\n0123456789') self.assertRaises(BodyNotTerminated, lambda: Frame.from_buffer(buff))
def test_parse_frame_empty_body(self): buff = io.BytesIO( b'SUBSCRIBE\nack:auto\ndestination:/queue/test\n\n\x00fdffdfd') f = Frame.from_buffer(buff)
def test_parse_frame_incomplete_body(self): buff = io.BytesIO(b'CONNECT\ncontent-length:1000\n\n0123456789\x00') self.assertRaises(IncompleteFrame, lambda: Frame.from_buffer(buff))