MCPcopy Index your code
hub / github.com/python/mypy / test_encode_bytes_values

Method test_encode_bytes_values

mypyc/test/test_literals.py:35–44  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

33 assert _encode_str_values({"y" * 100: 0}) == [bytes([1, 100]) + b"y" * 100, b""]
34
35 def test_encode_bytes_values(self) -> None:
36 assert _encode_bytes_values({}) == [b""]
37 assert _encode_bytes_values({b"foo": 0}) == [b"\x01\x03foo", b""]
38 assert _encode_bytes_values({b"foo": 0, b"b": 1}) == [b"\x02\x03foo\x01b", b""]
39 assert _encode_bytes_values({b"foo": 0, b"x" * 70: 1}) == [
40 b"\x01\x03foo",
41 bytes([1, 70]) + b"x" * 70,
42 b"",
43 ]
44 assert _encode_bytes_values({b"y" * 100: 0}) == [bytes([1, 100]) + b"y" * 100, b""]
45
46 def test_encode_int_values(self) -> None:
47 assert _encode_int_values({}) == [b""]

Callers

nothing calls this directly

Calls 2

_encode_bytes_valuesFunction · 0.90
bytesClass · 0.85

Tested by

no test coverage detected