()
| 580 | |
| 581 | #[test] |
| 582 | fn test_extract_str() { |
| 583 | let gil = Python::acquire_gil(); |
| 584 | let py = gil.python(); |
| 585 | let s = "Hello Python"; |
| 586 | let py_string = s.to_py_object(py).into_object(); |
| 587 | let mut called = false; |
| 588 | RefFromPyObject::with_extracted(py, &py_string, |s2: &str| { |
| 589 | assert_eq!(s, s2); |
| 590 | called = true; |
| 591 | }) |
| 592 | .unwrap(); |
| 593 | assert!(called); |
| 594 | } |
| 595 | |
| 596 | #[test] |
| 597 | fn test_extract_byte_str() { |
nothing calls this directly
no test coverage detected