style: reformat sub_pattern round-trip tests

This commit is contained in:
2026-07-14 13:51:51 -04:00
parent e68e4b7d57
commit 2608a3841f
@@ -95,12 +95,18 @@ def test_append_to_json_writes_sub_pattern(tmp_path):
def test_load_benchmark_restores_sub_pattern(tmp_path): def test_load_benchmark_restores_sub_pattern(tmp_path):
from app.question_gen.loader import load_benchmark from app.question_gen.loader import load_benchmark
import json import json
entry = { entry = {
"question_id": "v1_Action Recognition_0001", "video_id": "v1", "question_id": "v1_Action Recognition_0001",
"task_type": "Action Recognition", "question": "?", "video_id": "v1",
"options": ["A. 蒸", "B. 炒", "C. 煮", "D. 炸"], "answer": "A", "task_type": "Action Recognition",
"source_nodes": ["n1"], "difficulty": "hard", "question": "?",
"family": "ACTION_RECOGNITION", "skill_target": "M1_AR", "options": ["A. 蒸", "B. 炒", "C. 煮", "D. 炸"],
"answer": "A",
"source_nodes": ["n1"],
"difficulty": "hard",
"family": "ACTION_RECOGNITION",
"skill_target": "M1_AR",
"sub_pattern": "temporal_reasoning_failure", "sub_pattern": "temporal_reasoning_failure",
} }
(tmp_path / "v1.json").write_text(json.dumps([entry]), encoding="utf-8") (tmp_path / "v1.json").write_text(json.dumps([entry]), encoding="utf-8")
@@ -111,11 +117,16 @@ def test_load_benchmark_restores_sub_pattern(tmp_path):
def test_load_benchmark_sub_pattern_defaults_none_when_absent(tmp_path): def test_load_benchmark_sub_pattern_defaults_none_when_absent(tmp_path):
from app.question_gen.loader import load_benchmark from app.question_gen.loader import load_benchmark
import json import json
entry = { entry = {
"question_id": "v1_Object Recognition_0001", "video_id": "v1", "question_id": "v1_Object Recognition_0001",
"task_type": "Object Recognition", "question": "?", "video_id": "v1",
"options": ["A. a", "B. b", "C. c", "D. d"], "answer": "A", "task_type": "Object Recognition",
"source_nodes": ["n1"], "difficulty": "medium", "question": "?",
"options": ["A. a", "B. b", "C. c", "D. d"],
"answer": "A",
"source_nodes": ["n1"],
"difficulty": "medium",
} }
(tmp_path / "v1.json").write_text(json.dumps([entry]), encoding="utf-8") (tmp_path / "v1.json").write_text(json.dumps([entry]), encoding="utf-8")
loaded = load_benchmark(tmp_path) loaded = load_benchmark(tmp_path)