MCPcopy Create free account
hub / github.com/apache/fory / test_encode_empty_string

Function test_encode_empty_string

python/pyfory/tests/test_metastring.py:96–110  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

94
95
96def test_encode_empty_string():
97 encoder = MetaStringEncoder(special_char1=".", special_char2="_")
98 decoder = MetaStringDecoder(special_char1=".", special_char2="_")
99
100 for encoding in [
101 Encoding.LOWER_SPECIAL,
102 Encoding.LOWER_UPPER_DIGIT_SPECIAL,
103 Encoding.FIRST_TO_LOWER_SPECIAL,
104 Encoding.ALL_TO_LOWER_SPECIAL,
105 Encoding.UTF_8,
106 ]:
107 metastring = encoder.encode_with_encoding("", encoding)
108 assert len(metastring.encoded_data) == 0
109 decoded = decoder.decode(metastring.encoded_data, metastring.encoding)
110 assert decoded == ""
111
112
113def test_encode_characters_outside_of_lower_special():

Callers

nothing calls this directly

Calls 4

encode_with_encodingMethod · 0.95
decodeMethod · 0.95
MetaStringEncoderClass · 0.90
MetaStringDecoderClass · 0.90

Tested by

no test coverage detected