I'm writing a library in Python which makes calls to a REST API, receives results in JSON, and returns Python class instances after transforming the results.
Is there a generally accepted way of including test fixtures (ie JSON files to test against) inside of the Python package and test namespace to load and test against in your test cases?
You could try using the mock module. and mock the request.get like in this post Mock, UnitTest, JSON
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With