def test_pack_json(): assert Buffer.pack_json({"spam": "eggs"}) == b'\x10{"spam": "eggs"}'
def to_bytes(self): return Buffer.pack_json(self.value)