style: reformat sub_pattern round-trip tests
This commit is contained in:
@@ -95,12 +95,18 @@ def test_append_to_json_writes_sub_pattern(tmp_path):
|
||||
def test_load_benchmark_restores_sub_pattern(tmp_path):
|
||||
from app.question_gen.loader import load_benchmark
|
||||
import json
|
||||
|
||||
entry = {
|
||||
"question_id": "v1_Action Recognition_0001", "video_id": "v1",
|
||||
"task_type": "Action Recognition", "question": "?",
|
||||
"options": ["A. 蒸", "B. 炒", "C. 煮", "D. 炸"], "answer": "A",
|
||||
"source_nodes": ["n1"], "difficulty": "hard",
|
||||
"family": "ACTION_RECOGNITION", "skill_target": "M1_AR",
|
||||
"question_id": "v1_Action Recognition_0001",
|
||||
"video_id": "v1",
|
||||
"task_type": "Action Recognition",
|
||||
"question": "?",
|
||||
"options": ["A. 蒸", "B. 炒", "C. 煮", "D. 炸"],
|
||||
"answer": "A",
|
||||
"source_nodes": ["n1"],
|
||||
"difficulty": "hard",
|
||||
"family": "ACTION_RECOGNITION",
|
||||
"skill_target": "M1_AR",
|
||||
"sub_pattern": "temporal_reasoning_failure",
|
||||
}
|
||||
(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):
|
||||
from app.question_gen.loader import load_benchmark
|
||||
import json
|
||||
|
||||
entry = {
|
||||
"question_id": "v1_Object Recognition_0001", "video_id": "v1",
|
||||
"task_type": "Object Recognition", "question": "?",
|
||||
"options": ["A. a", "B. b", "C. c", "D. d"], "answer": "A",
|
||||
"source_nodes": ["n1"], "difficulty": "medium",
|
||||
"question_id": "v1_Object Recognition_0001",
|
||||
"video_id": "v1",
|
||||
"task_type": "Object Recognition",
|
||||
"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")
|
||||
loaded = load_benchmark(tmp_path)
|
||||
|
||||
Reference in New Issue
Block a user