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

Function test_encode_bytes

tests/test_encoding.py:86–91  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

84
85
86def test_encode_bytes():
87 enc = tiktoken.get_encoding("cl100k_base")
88 assert enc._encode_bytes(b" \xec\x8b\xa4\xed") == [62085]
89 for i in range(10):
90 bytestring = b"\x80" * i
91 assert enc.decode_bytes(enc._encode_bytes(bytestring)) == bytestring
92
93
94@pytest.mark.parametrize("make_enc", ENCODING_FACTORIES)

Callers

nothing calls this directly

Calls 2

_encode_bytesMethod · 0.80
decode_bytesMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…