MCPcopy Create free account
hub / github.com/pybind/pybind11 / test_map

Function test_map

tests/test_stl.py:79–91  ·  view source on GitHub ↗

std::map <-> dict

(doc)

Source from the content-addressed store, hash-verified

77
78
79def test_map(doc):
80 """std::map <-> dict"""
81 d = m.cast_map()
82 assert d == {"key": "value"}
83 assert "key" in d
84 d["key2"] = "value2"
85 assert "key2" in d
86 assert m.load_map(d)
87
88 assert doc(m.cast_map) == "cast_map() -> dict[str, str]"
89 assert (
90 doc(m.load_map) == "load_map(arg0: collections.abc.Mapping[str, str]) -> bool"
91 )
92
93
94def test_set(doc):

Callers

nothing calls this directly

Calls 1

docFunction · 0.70

Tested by

no test coverage detected