Files
transcription/tests/test_traceability.py
T
2026-06-26 14:23:12 -05:00

68 lines
2.0 KiB
Python

"""Requirement-to-test traceability checks for MVP in-scope requirements."""
from pathlib import Path
import pytest
MVP_REQUIREMENT_TEST_MAP: dict[str, list[str]] = {
"REQ-0": [
"tests/integration/test_pipeline_flow.py",
],
"REQ-1": [
"tests/services/test_upload.py",
"tests/ui/test_upload_page.py",
],
"REQ-2": [
"tests/services/test_worker.py",
"tests/integration/test_pipeline_flow.py",
],
"REQ-3": [
"tests/services/test_worker.py",
"tests/ui/test_jobs_page.py",
"tests/services/test_library.py",
],
"REQ-4": [
"tests/services/test_worker.py",
"tests/integration/test_pipeline_flow.py",
"tests/services/test_library.py",
],
"REQ-5": [
"tests/ui/test_jobs_page.py",
"tests/ui/test_pages_registration.py",
"tests/api/test_routes.py",
],
"REQ-6": [
"tests/test_app.py",
"tests/services/test_worker.py",
],
"REQ-8": [
"tests/test_app.py",
"tests/test_config.py",
],
"REQ-11": [
"tests/services/test_library.py",
],
"REQ-12": [
"tests/test_prompts.py",
"tests/services/test_transcription.py",
],
}
@pytest.mark.integration
class TestMvpRequirementTraceability:
"""Verify MVP in-scope requirements are mapped to executable tests."""
def test_mvp_requirements_have_mapped_test_targets(self):
"""Each MVP in-scope REQ id maps to at least one existing test path."""
project_root = Path(__file__).resolve().parents[1]
assert MVP_REQUIREMENT_TEST_MAP
for requirement_id, mapped_tests in MVP_REQUIREMENT_TEST_MAP.items():
assert requirement_id.startswith("REQ-")
assert mapped_tests, f"No mapped tests for {requirement_id}"
for relative_path in mapped_tests:
test_path = project_root / relative_path
assert test_path.exists(), f"Missing mapped test file for {requirement_id}: {relative_path}"