We need to implement automatic tests for the most critical API endpoints! Please use the FastAPI testing clients for this: https://fastapi.tiangolo.com/tutorial/testing/. The tests should run outside of the containers with pytest, i.e., for them to run, first, all "auxiliary" docker services have to be up and running. Later, we will check how to run the tests inside the container.
For this, I thought of the following typical actions that start with a fresh and clean DATS instance:
Users and Projects
[x] 1. Create three new users: Alice, Bob, Charlie
[x] 2. Create a new project P1 with user Alice
[x] 3. Create a new project P2 with user Bob
[x] 4. Associate Bob to P1
[x] 5. Try to access P2 with Alice --> This should fail!
[x] 6. Associate Alice to P2
[x] 7. Try to access P2 with Alice --> This should work now!
[x] 8. Rename Project P1 to P3 and P2 to P4 and update the descriptions
[x] 10. Update the email and password of Charlie
[x] 11. Delete user Charlie
Codes and Annotations
[x] 9. Create new Codes C1, C2, C3 in P3
[x] 10. Create new Codes C4, C5, C6 in P4
[x] 11. Upload two text documents (TD1, TD2), two image documents (ID1, ID2), two (short) audio documents (AD1, AD2), and two (short) video documents (VD1, VD2) in P3
[x] 12. Upload two text documents (TD3, TD4), two image documents (ID3, ID4), two (short) audio documents (AD3, AD4), and two (short) video documents (VD3, VD4) in P4
[x] 13. Create two text annotations (TA1, TA2) in TD1 and one text annotation (TA3) in TD2 with Alice. TA1 and TA2 have to be overlapping.
[x] 14. Create two text annotations (TA4, TA5) in TD1 and one text annotation (TA6) in TD2 with Bob. TA4 and TA1 have to be overlapping. Remove the annotations afterwards.
[x] 15. Create two image annotations (IA1, IA2) in ID1 with Alice.
[x] 16. Create two image annotations (IA3, IA4) in ID1 and ID2, respectively, with Bob. Remove the annotations afterwards
[ ] TBC
Tags
[ ] TBD
Memos
[x] Create a memo in P1 with Alice
Search and Filter
[ ] TBD
Feedback
[x] Create feedback in P2 with Bob.
Project Metadata
[x] Create Metadata for P1 with Alice. Update the Metadata with Bob. Remove the Metadata afterwards with Bob.
We need to implement automatic tests for the most critical API endpoints! Please use the FastAPI testing clients for this: https://fastapi.tiangolo.com/tutorial/testing/. The tests should run outside of the containers with
pytest
, i.e., for them to run, first, all "auxiliary" docker services have to be up and running. Later, we will check how to run the tests inside the container.For this, I thought of the following typical actions that start with a fresh and clean DATS instance:
Users and Projects
Codes and Annotations
Tags
Memos
Search and Filter
Feedback
Project Metadata
Deletion OPs