Unit test fixtures in Python?

I am writing a Python library that calls the REST API, receives the results in JSON, and returns instances of the Python class after converting the results.

Is there a generally accepted way to include test devices (e.g. JSON files for testing) inside the Python package and test namespace for loading and testing in test cases?

+4
source share
1 answer

You can try using the mock module. and make fun of request.get as in this post Mock, UnitTest, JSON

0
source

All Articles