MCPcopy Create free account
hub / github.com/dgrunwald/rust-cpython / test_seq_empty

Function test_seq_empty

src/objects/sequence.rs:342–355  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

340 }
341 #[test]
342 fn test_seq_empty() {
343 let gil = Python::acquire_gil();
344 let py = gil.python();
345 let v: Vec<i32> = vec![];
346 let seq = v
347 .to_py_object(py)
348 .into_object()
349 .cast_into::<PySequence>(py)
350 .unwrap();
351 assert_eq!(0, seq.len(py).unwrap());
352
353 let needle = 7i32.to_py_object(py).into_object();
354 assert_eq!(false, seq.contains(py, &needle).unwrap());
355 }
356
357 #[test]
358 fn test_seq_contains() {

Callers

nothing calls this directly

Calls 3

pythonMethod · 0.80
into_objectMethod · 0.45
to_py_objectMethod · 0.45

Tested by

no test coverage detected