davidhewitt / pythonize

MIT License
198 stars 28 forks source link

test_nested_struct #68

Closed bit-web24 closed 1 month ago

bit-web24 commented 1 month ago

Added testcase for serializing nested struct.

    #[test]
    fn test_nested_struct() {
        #[derive(Serialize)]
        struct Foo {
            name: String,
            bar: Bar,
        }

        #[derive(Serialize)]
        struct Bar {
            name: String,
        }

        test_ser(
            Foo {
                name: "foo".to_string(),
                bar: Bar {
                    name: "bar".to_string(),
                },
            },
            r#"{"name":"foo","bar":{"name":"bar"}}"#,
        )
    }
codecov[bot] commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 80.81%. Comparing base (c29579f) to head (dd0beb9).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #68 +/- ## ========================================== + Coverage 80.41% 80.81% +0.39% ========================================== Files 3 3 Lines 1062 1084 +22 Branches 1062 1084 +22 ========================================== + Hits 854 876 +22 Misses 160 160 Partials 48 48 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

MarshalX commented 1 month ago

@davidhewitt CI fails on macOS for lower Python versions. I think because of "macos-latest" which was bumped recently and now uses M1-powered runners. Which is ARM. To fix arch compatibility we can simply move to the runner "macos-13"

davidhewitt commented 1 month ago

Understood, let's merge here and I can resolve separately 👍