MCPcopy Create free account
hub / github.com/YuminosukeSato/ironkernel / task_result_wraps_buffer

Function task_result_wraps_buffer

src/python/py_task.rs:186–198  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

184
185 #[test]
186 fn task_result_wraps_buffer() {
187 pyo3::prepare_freethreaded_python();
188
189 Python::with_gil(|py| {
190 let handle = TaskHandle::new();
191 let buf = crate::buffer::inner::Buffer::from_f64_vec(vec![1.0, 2.0, 3.0]);
192 handle.complete(TaskResult::Buffer(buf));
193
194 let result = PyTaskHandle::new(handle).result(py).unwrap();
195 let result = result.extract::<PyBuffer>(py).unwrap();
196 assert_eq!(result.inner.as_f64_slice(), &[1.0, 2.0, 3.0]);
197 });
198 }
199
200 #[test]
201 fn task_result_returns_python_object_for_callable_why_callable_go_must_not_force_buffer_wrapping(

Callers

nothing calls this directly

Calls 3

BufferClass · 0.85
completeMethod · 0.45
resultMethod · 0.45

Tested by

no test coverage detected