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

Function test_parse

src/argparse.rs:560–573  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

558
559 #[test]
560 pub fn test_parse() {
561 let gil_guard = Python::acquire_gil();
562 let py = gil_guard.python();
563 let mut called = false;
564 let tuple = ("abc", 42).to_py_object(py);
565 py_argparse!(py, None, &tuple, None, (x: &str, y: i32) {
566 assert_eq!(x, "abc");
567 assert_eq!(y, 42);
568 called = true;
569 Ok(())
570 })
571 .unwrap();
572 assert!(called);
573 }
574
575 #[test]
576 pub fn test_default_param_type() {

Callers

nothing calls this directly

Calls 2

pythonMethod · 0.80
to_py_objectMethod · 0.45

Tested by

no test coverage detected