MCPcopy
hub / github.com/msgspec/msgspec / test_decode_str_or_bytes_like

Function test_decode_str_or_bytes_like

tests/unit/test_yaml.py:136–142  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

134
135
136def test_decode_str_or_bytes_like():
137 assert msgspec.yaml.decode("[1, 2]") == [1, 2]
138 assert msgspec.yaml.decode(b"[1, 2]") == [1, 2]
139 assert msgspec.yaml.decode(bytearray(b"[1, 2]")) == [1, 2]
140 assert msgspec.yaml.decode(memoryview(b"[1, 2]")) == [1, 2]
141 with pytest.raises(TypeError):
142 msgspec.yaml.decode(1)
143
144
145@pytest.mark.parametrize("msg", [b"{{", b"!!binary 123"])

Callers

nothing calls this directly

Calls 1

decodeMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…