def test_encoding(self): encoded = txt.encode_text(self.test_text_known_chars) decoded = txt.decode_to_text(encoded) self.assertEqual( self.test_text_known_chars, decoded, msg="On a sequence of supported characters, encoding, " "then decoding should yield the original string.")
def test_unknown_encoding(self): encoded = txt.encode_text(self.test_text_unknown_char) decoded = txt.decode_to_text(encoded) original_fix = self.test_text_unknown_char[:-1] + chr(0) self.assertEqual( original_fix, decoded, msg="The last character of the test sequence is an unsupported " "character and should be encoded and decoded as 0.")