waleedkadous / ansari-backend

Ansari is a helper for you to become a better Muslim
65 stars 12 forks source link

Increase Test Coverage to 100% for Critical Modules #23

Open abdullah-alnahas opened 3 months ago

abdullah-alnahas commented 3 months ago

I used pytest-cov to assess the test coverage of the codebase. Here's the report generated after executing python -m pytest --cov=.

---------- coverage: platform linux, python 3.10.12-final-0 ----------
Name                           Stmts   Miss  Cover
--------------------------------------------------
__init__.py                        0      0   100%
agents/__init__.py                 0      0   100%
agents/ansari.py                 153     38    75%
ansari_db.py                     300    151    50%
api_v2_exercise.py               134    134     0%
main_api.py                      286    149    48%
main_discord.py                    6      6     0%
main_file.py                       6      6     0%
main_gradio.py                     6      6     0%
main_stdio.py                      8      8     0%
presenters/api_presenter.py       20      4    80%
tests/__init__.py                  0      0   100%
tests/test_answer_quality.py      61      8    87%
tests/test_main_api.py            99      0   100%
tools/__init__.py                  0      0   100%
tools/search_hadith.py            36     19    47%
tools/search_quran.py             38      4    89%
util/prompt_mgr.py                17      0   100%
--------------------------------------------------
TOTAL                           1170    533    54%

TODO: Increase test coverage to 100% for the following files: