feat(task-022): expand discovery coverage

This commit is contained in:
2026-06-04 07:42:48 +01:00
parent a0b28e7d8d
commit c72ad6995e
8 changed files with 341 additions and 25 deletions
+2 -2
View File
@@ -3,9 +3,9 @@ from pathlib import Path
import rdb_discovery.discovery as discovery_mod
def test_core_questions_returns_10_items() -> None:
def test_core_questions_returns_at_least_10_items() -> None:
questions = discovery_mod.core_questions()
assert len(questions) == 10
assert len(questions) >= 10
def test_append_creates_file_when_missing(tmp_path: Path) -> None:
+3 -3
View File
@@ -28,14 +28,14 @@ def test_mapping_file_exists() -> None:
assert mapping_path.exists(), f"Mapping file missing: {mapping_path}"
def test_mapping_contains_all_10_questions() -> None:
def test_mapping_contains_all_questions() -> None:
"""Every core discovery question must appear in the mapping."""
from rdb_discovery.templates import CORE_QUESTIONS
root = _get_project_root()
mapping_path = root / MAPPING_FILE
content = mapping_path.read_text(encoding="utf-8")
for question in CORE_QUESTIONS:
assert question in content, f"Question not mapped: {question}"
+9 -5
View File
@@ -84,11 +84,13 @@ class TestGenerateContextFiles:
mapping_path = root / "context/discovery-context-mapping.md"
assert mapping_path.exists()
def test_mapping_covers_all_10_questions(self):
"""All 10 core questions should have mappings."""
def test_mapping_covers_all_questions(self):
"""All core questions should have mappings."""
from rdb_discovery.generate_context import CONTEXT_MAP
from rdb_discovery.templates import CORE_QUESTIONS
for i in range(1, 11):
expected_count = len(CORE_QUESTIONS)
for i in range(1, expected_count + 1):
qid = f"Q-{i:03d}"
assert qid in CONTEXT_MAP, f"Missing mapping for {qid}"
@@ -194,11 +196,13 @@ class TestContentPreservation:
class TestContextMapCompleteness:
"""Tests for mapping document completeness."""
def test_all_10_questions_mapped(self):
def test_all_questions_mapped(self):
"""Every core question should have a mapping entry."""
from rdb_discovery.generate_context import CONTEXT_MAP
from rdb_discovery.templates import CORE_QUESTIONS
expected_ids = {f"Q-{i:03d}" for i in range(1, 11)}
expected_count = len(CORE_QUESTIONS)
expected_ids = {f"Q-{i:03d}" for i in range(1, expected_count + 1)}
mapped_ids = set(CONTEXT_MAP.keys())
assert expected_ids == mapped_ids, f"Missing mappings: {expected_ids - mapped_ids}"