- Hands-On Docker for Microservices with Python
- Jaime Buelta
- 89字
- 2021-06-24 12:35:52
test_thoughts.py
This file checks the defined API interfaces. Each API is tested to perform the actions correctly (create a new thought, return thoughts of a user, retrieve all thoughts, search through thoughts, and retrieve a thought by ID) as well as some error tests (unauthorized requests to create and retrieve thoughts of a user, or retrieve a non-existing thought).
Here, we use freezegun again to determine when the thoughts are created, instead of creating them with a timestamp dependent on the time when tests are run.