mozilla-it / pocket-proxy-rs

Rust implementation of the Pocket sponsored content proxy
Mozilla Public License 2.0
2 stars 0 forks source link

chore(tests): Add some unit tests for response models #3

Closed bkochendorfer closed 2 years ago

bkochendorfer commented 2 years ago

@smarnach on my local machine the following test (not one I added) always fails. It looks like we are expecting a string but the test mock has a float. We actually convert the string to a float in the code so I'm not sure what we expect from Adzerk.

---- adzerk::response_models::tests::test_deserialize_decisions stdout ----
thread 'adzerk::response_models::tests::test_deserialize_decisions' panicked at 'called `Result::unwrap()` on an `Err` value: Error("invalid type: floating point `0.01`, expected a string", line: 24, column: 39)', src/adzerk/response_models.rs:294:89
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
bkochendorfer commented 2 years ago

This was great feedback, thanks @smarnach. I've updated the tests and made an attempt at modifying the URL param creation code.