diff --git a/Cargo.lock b/Cargo.lock index 8ba9ad058..a163c6ce9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -966,6 +966,7 @@ dependencies = [ "serde", "serde_json", "simple_logger", + "tempfile", ] [[package]] diff --git a/packages/cw-schema-codegen/Cargo.toml b/packages/cw-schema-codegen/Cargo.toml index 984819e37..581468a6e 100644 --- a/packages/cw-schema-codegen/Cargo.toml +++ b/packages/cw-schema-codegen/Cargo.toml @@ -28,3 +28,4 @@ insta = "1.40.0" rand = { version = "0.8.5", features = ["min_const_gen"] } serde = { workspace = true, features = ["derive"] } serde_json = "1.0.128" +tempfile = "3.14.0" diff --git a/packages/cw-schema-codegen/tests/python_tpl.rs b/packages/cw-schema-codegen/tests/python_tpl.rs index 347d977b0..60764c8ca 100644 --- a/packages/cw-schema-codegen/tests/python_tpl.rs +++ b/packages/cw-schema-codegen/tests/python_tpl.rs @@ -56,7 +56,7 @@ fn simple_enum() { macro_rules! validator { ($typ:ty) => {{ - let a: Box ()> = Box::new(|output| { + let a: Box = Box::new(|output| { serde_json::from_str::<$typ>(output).unwrap(); }); a @@ -130,7 +130,7 @@ fn assert_validity() { let mut file = tempfile::NamedTempFile::with_suffix(".py").unwrap(); file.write_all(schema_output.as_bytes()).unwrap(); - file.write( + file.write_all( format!( "import sys; print({type_name}.model_validate_json('{example}').model_dump_json())" )