def test_read_payload_returns_a_payload(self): io = StringIO(('FEEDDEADBEEF' + self.padding).decode('hex')) self.assertEqual(Parser.read_payload(io, 6), 'FEEDDEADBEEF'.decode('hex')) self.assertEqual(io.pos, 6)
def test_read_payload_returns_a_payload(self): io = BytesIO(codecs.decode('FEEDDEADBEEF' + self.padding, 'hex_codec')) self.assertEqual(Parser.read_payload(io, 6), codecs.decode('FEEDDEADBEEF', 'hex_codec')) self.assertEqual(io.tell(), 6)