Reputation: 91620
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?
Upvotes: 6
Views: 1526
Reputation: 37
You could try using the mock module. and mock the request.get like in this post Mock, UnitTest, JSON
Upvotes: 0