MCPcopy Create free account
hub / github.com/dgrunwald/rust-cpython / test_btreemap_to_python

Function test_btreemap_to_python

src/objects/tests.rs:39–50  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

37
38#[test]
39fn test_btreemap_to_python() {
40 let gil = Python::acquire_gil();
41 let py = gil.python();
42
43 let mut map = BTreeMap::<i32, i32>::new();
44 map.insert(1, 1);
45
46 let py_map = map.to_py_object(py);
47
48 assert!(py_map.len(py) == 1);
49 assert!(py_map.get_item(py, 1).unwrap().extract::<i32>(py).unwrap() == 1);
50}

Callers

nothing calls this directly

Calls 3

pythonMethod · 0.80
insertMethod · 0.80
to_py_objectMethod · 0.45

Tested by

no test coverage detected