MCPcopy Index your code
hub / github.com/davidhewitt/pythonize / test_rename_key_present

Function test_rename_key_present

tests/test_structs.rs:84–95  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

82
83#[test]
84fn test_rename_key_present() {
85 Python::attach(|py| {
86 let original = WithRename {
87 first_name: "Bob".into(),
88 age: 30,
89 };
90 let py_obj = pythonize(py, &original).unwrap();
91 let dict = py_obj.cast::<PyDict>().unwrap();
92 assert!(dict.get_item("firstName").unwrap().is_some());
93 assert!(dict.get_item("first_name").unwrap().is_none());
94 });
95}
96
97#[test]
98fn test_rename_round_trip() {

Callers

nothing calls this directly

Calls 1

pythonizeFunction · 0.85

Tested by

no test coverage detected