()
| 178 | |
| 179 | #[test] |
| 180 | fn test_option_none_round_trip() { |
| 181 | Python::attach(|py| { |
| 182 | let original = WithOption { |
| 183 | label: "x".into(), |
| 184 | count: None, |
| 185 | }; |
| 186 | let py_obj = pythonize(py, &original).unwrap(); |
| 187 | let dict = py_obj.cast::<PyDict>().unwrap(); |
| 188 | let count_opt = dict.get_item("count").unwrap(); |
| 189 | assert!(count_opt.is_some()); |
| 190 | assert!(count_opt.unwrap().is_none()); |
| 191 | let result: WithOption = depythonize(&py_obj).unwrap(); |
| 192 | assert_eq!(result, original); |
| 193 | }); |
| 194 | } |
| 195 | |
| 196 | // --- Option<T> Some --- |
| 197 |
nothing calls this directly
no test coverage detected