//! Emits the Python client as an importable package, drops a recording stand-in //! for the PyO3 kernel beside it, and runs a consumer script under CPython. The //! consumer imports the package, calls every generated method and reads the //! Pydantic models back, so the emitted module has to import and execute. mod harness; use mizan_codegen::emit::CodegenTarget; use mizan_codegen::emit::python::PythonClient; #[test] fn generated_package_imports_and_every_method_runs() { let root = harness::scratch_root("python"); let ir = harness::load_ir("afi_ir.kdl"); harness::write_emitted( &root.join("mizan_client"), &PythonClient.emit(&ir, &harness::config_for("python")), ); harness::copy_fixture("mizan_rust.py", &root.join("mizan_rust.py")); harness::copy_fixture("python_driver.py", &root.join("driver.py")); let uv = harness::resolve_on_path("uv"); harness::run_tool( &uv, &["run", "--no-project", "--with", "pydantic", "python", "driver.py"], &root, &[], "the emitted Python client does not import or its consumer run fails", ); }