ai-cfia / ailab-datastore

This is a repo representing the data layer of multiple ailab projects
MIT License
2 stars 0 forks source link

As a dev, I want to replace direct SQL queries in tests with existing Python functions for better maintainability #158

Open k-allagbe opened 1 month ago

k-allagbe commented 1 month ago

Description:

In some test cases, SQL queries are written directly within the tests, even though there are existing Python functions and Pydantic models that could be used instead. This makes the tests harder to maintain and introduces redundancy. The goal is to replace all direct SQL queries in the test cases with calls to the appropriate existing Python functions and Pydantic models, ensuring the tests are easier to maintain, consistent, and align with the project structure.

Additionally, the folder structure for the tests has deviated from the original, making it harder to navigate. The folder structure should be reworked to match the original project structure for better maintainability.

Acceptance Criteria:

Francois-Werbrouck commented 1 month ago

I suggest we also invest a bit of time to use the InspectionDB model in necessary tests

Francois-Werbrouck commented 1 month ago

I also suggest in this issue we rework the tests to keep the object tests structure. Currently we have tests for each of our objects but we also have a update folder (and now a delete folder?) which tests each objects for their respective operation. We should keep all the tests for the same object into the object query tests file.

k-allagbe commented 1 month ago

I also suggest in this issue we rework the tests to keep the object tests structure. Currently we have tests for each of our objects but we also have a update folder (and now a delete folder?) which tests each objects for their respective operation. We should keep all the tests for the same object into the object query tests file.

Updated.