MCPcopy
hub / github.com/openai/tiktoken / test_basic_roundtrip

Function test_basic_roundtrip

tests/test_encoding.py:133–146  ·  view source on GitHub ↗
(make_enc)

Source from the content-addressed store, hash-verified

131
132@pytest.mark.parametrize("make_enc", ENCODING_FACTORIES)
133def test_basic_roundtrip(make_enc):
134 enc = make_enc()
135 for value in (
136 "hello",
137 "hello ",
138 "hello ",
139 " hello",
140 " hello ",
141 " hello ",
142 "hello world",
143 "请考试我的软件!12345",
144 ):
145 assert value == enc.decode(enc.encode(value))
146 assert value == enc.decode(enc.encode_ordinary(value))
147
148
149@pytest.mark.parametrize("make_enc", ENCODING_FACTORIES)

Callers

nothing calls this directly

Calls 3

encode_ordinaryMethod · 0.80
decodeMethod · 0.45
encodeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…