We want to improve backend testing, currently we test each route with a success case and an error case. The current problem is that our tests are dependent of the datastore and each tests commit changes to the database and therefore shouldn't be committed. Tests should avoid any direct interaction with the Azure storage and database, as these interactions incur costs and risk generating incorrect data.
Objective
Making sure that all routes work.
Deleting the entries in the database if some are created
The file test_manage_folders.py is an example of what we want for route tests, but feel free to improve it.
Acceptance criteria:
[ ] all routes have a unit test using a mock/patch for datastore functions :
This issue follows on from this one #92 Improve backend tests
Context
We want to improve backend testing, currently we test each route with a success case and an error case. The current problem is that our tests are dependent of the datastore and each tests commit changes to the database and therefore shouldn't be committed. Tests should avoid any direct interaction with the Azure storage and database, as these interactions incur costs and risk generating incorrect data.
Objective
Making sure that all routes work. Deleting the entries in the database if some are created The file test_manage_folders.py is an example of what we want for route tests, but feel free to improve it.
Acceptance criteria: