def test_string_decode_encode(self): from klvdata.common import bytes_to_str from klvdata.common import str_to_bytes self.assertEqual( str_to_bytes(bytes_to_str(b'\x50\x72\x65\x64\x61\x74\x6F\x72')), b'\x50\x72\x65\x64\x61\x74\x6F\x72')
def __bytes__(self): return str_to_bytes(self.value)