Spaces:
Running
Running
|
Download tests/codemap.md from Deign86/mathpulse-api-v3test: direct link, hf CLI and curl.
- Browser
- Download file 1.58 kB
-
https://huggingface.co/spaces/Deign86/mathpulse-api-v3test/resolve/main/tests/codemap.md
- Command line
-
hf download hf://spaces/Deign86/mathpulse-api-v3test/tests/codemap.md
-
curl -L -o codemap.md https://huggingface.co/spaces/Deign86/mathpulse-api-v3test/resolve/main/tests/codemap.md
1.58 kB
backend/tests/
Responsibility
Python regression and contract tests for backend routes, services, RAG retrieval/ingestion, and startup behavior.
Design
- Pytest test modules use focused test functions/classes and
unittest.mockfixtures to isolate external boundaries. conftest.pyprovides Firebase auth/Firebase Admin test doubles so tests do not require production credentials.- Route tests use FastAPI
TestClientandmain.app; unit tests import service/RAG symbols directly. - Representative coverage:
test_rag_pipeline.py,test_160_rag_lesson_retrieval.py,test_video_routes.py,test_admin_model_routes.py,test_wri_service.py, andtest_memory_health.py.
Flow
- Test setup →
conftest.pypatches Firebase boundaries → imports route/service modules or constructsTestClient(app). - Requests exercise route → handler → mocked or real-in-process service contracts; assertions cover status, response shape, authorization, and persistence behavior.
- RAG tests call retrieval/parsing helpers directly and validate filters, exact-file behavior, lesson context, and ingestion transformations.
- Service tests validate deterministic logic such as WRI, email configuration, model profiles, caching, and memory health.
Integration
- Tests mirror
/api/...route → handler → service → Firestore/DeepSeek/RAG Chroma boundaries while mocking external dependencies as appropriate. - Test modules are consumers of
backend/main.py,backend/routes/,backend/services/, andbackend/rag/; they do not define production APIs.