This PR adds the factory function for mock spocs, and a test that all mock decisions convert into the expected spocs. This is basically an integration test for the most complex part of the JSON transformation, and it did not uncover any bugs.
I added the assert-json-diff crate as a dev dependency – otherwise, you'd just get deeply nested serde_json::Values thrown at you in an all but unreadable format.
I had to change the image URL in the test data to make it pass the validation. The validation is separate in the Python code, so they can test the transformation with an invalid image URL, but since we included the validation in the transformation code, we can only usefully test with a valid image URL.
This does not include the "collections" from mock_spoc.py yet. They should go in a separate test.
This PR adds the factory function for mock spocs, and a test that all mock decisions convert into the expected spocs. This is basically an integration test for the most complex part of the JSON transformation, and it did not uncover any bugs.
serde_json::Value
s thrown at you in an all but unreadable format.mock_spoc.py
yet. They should go in a separate test.