def testString(self): text = "more tests, and stuff" buff = Buffer() buff.buff = buff.pack_string(text) self.assertTrue(text == buff.unpack_string())
def test_pack_string(): assert Buffer.pack_string("spam") == b"\x04spam"