MCPcopy Index your code
hub / github.com/AI45Lab/Code / py_to_step_spec_missing_required_field_errors

Function py_to_step_spec_missing_required_field_errors

sdk/python/src/lib.rs:7470–7484  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

7468
7469 #[test]
7470 fn py_to_step_spec_missing_required_field_errors() {
7471 pyo3::prepare_freethreaded_python();
7472 Python::with_gil(|py| {
7473 let dict = PyDict::new(py);
7474 dict.set_item("task_id", "t1").unwrap();
7475 dict.set_item("agent", "explore").unwrap();
7476 dict.set_item("description", "d").unwrap();
7477 // No "prompt" — a required field with no serde default.
7478 let err = py_to_step_spec(py, dict.as_any()).unwrap_err();
7479 assert!(
7480 err.to_string().contains("AgentStepSpec") || err.to_string().contains("prompt"),
7481 "got: {err}"
7482 );
7483 });
7484 }
7485
7486 #[test]
7487 fn step_outcome_to_py_uses_snake_case_keys() {

Callers

nothing calls this directly

Calls 1

py_to_step_specFunction · 0.85

Tested by

no test coverage detected