bacpilot-backend / tests /test_cross_validation_numeric_adapter.py
debpc
Add cross-validation numeric adapter
46be823
Raw
History Blame Contribute Delete
1.21 kB
from app.schemas.cross_validation import CrossValidationReport, EngineStatus, EquivalenceStatus, ConfidenceImpact
from app.services.cross_validation_numeric_adapter import cross_validation_report_to_numeric_check
def test_cross_validation_report_becomes_valid_numeric_check() -> None:
report = CrossValidationReport(
student_extracted_answer="3",
llm_solved_answer="{3}",
llm_solution_status=EngineStatus.OK,
wolfram_query="Solve[3 x - 9 == 0, x]",
wolfram_status=EngineStatus.OK,
wolfram_reference_result="x = 3",
student_vs_wolfram=EquivalenceStatus.EQUIVALENT,
llm_vs_wolfram=EquivalenceStatus.EQUIVALENT,
student_vs_llm=EquivalenceStatus.EQUIVALENT,
comparison_method="controlled_school_rule",
confidence_impact=ConfidenceImpact.INCREASE,
needs_human_review=False,
reason="consistent",
)
check = cross_validation_report_to_numeric_check(report)
assert check.check_type == "equivalence"
assert check.is_valid is True
assert check.expression == "3"
assert check.expected == "x = 3"
assert check.confidence_impact == "increase"
assert check.human_review_reason is None