I have to update the dev guidelines still to reflect this, but for tests we want to do the following:
- have a migration test which compares the PHP to the Python endpoint by calling the APIs
- have a 'happy path test' of the Python endpoint by calling the API
- have tests on input validation that call the Python API. This specifically concerns input validation that should be handled through FastAPI+Pydantic's function type annotation.
- otherwise test the behavior of the function, including correct processing of parameters and raising of errors, through calling the Python function which implements the endpoint correctly. Because it's quite a bit faster (the Client fixture is expensive) and output comparison is cleaner for endpoints which have a defined output type ( instead of JSON objects).
See #298 for an example.
@saathviksheerla will work on this, unless otherwise indicated by them.
I have to update the dev guidelines still to reflect this, but for tests we want to do the following:
See #298 for an example.
@saathviksheerla will work on this, unless otherwise indicated by them.