MCPcopy Create free account
hub / github.com/davidhewitt/pythonize / test_rename_all_keys_present

Function test_rename_all_keys_present

tests/test_structs.rs:113–126  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

111
112#[test]
113fn test_rename_all_keys_present() {
114 Python::attach(|py| {
115 let original = WithRenameAll {
116 first_name: "Jane".into(),
117 last_name: "Doe".into(),
118 year_of_birth: 1990,
119 };
120 let py_obj = pythonize(py, &original).unwrap();
121 let dict = py_obj.cast::<PyDict>().unwrap();
122 assert!(dict.get_item("firstName").unwrap().is_some());
123 assert!(dict.get_item("lastName").unwrap().is_some());
124 assert!(dict.get_item("yearOfBirth").unwrap().is_some());
125 });
126}
127
128#[test]
129fn test_rename_all_round_trip() {

Callers

nothing calls this directly

Calls 1

pythonizeFunction · 0.85

Tested by

no test coverage detected