feat(question_gen): register ActionRecognitionStrategy, replace temp VISUAL binding
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -116,3 +116,27 @@ class TestSubPattern:
|
||||
)
|
||||
with pytest.raises(AttributeError):
|
||||
sp.name = "changed"
|
||||
|
||||
|
||||
class TestActionRecognitionRegistration:
|
||||
"""AR 策略注册后 get_strategy 返回特化实例。"""
|
||||
|
||||
def test_get_strategy_returns_ar_strategy(self):
|
||||
"""get_strategy('Action Recognition') 返回 ActionRecognitionStrategy。"""
|
||||
from app.question_gen.strategy_action_recognition import ActionRecognitionStrategy
|
||||
|
||||
s = get_strategy("Action Recognition")
|
||||
assert isinstance(s, ActionRecognitionStrategy)
|
||||
assert s.task_type == "Action Recognition"
|
||||
assert s.strategy_name == "ACTION_RECOGNITION"
|
||||
|
||||
def test_ar_not_base_strategy(self):
|
||||
"""get_strategy('Action Recognition') 不再返回 BaseTaskTypeStrategy。"""
|
||||
s = get_strategy("Action Recognition")
|
||||
assert not isinstance(s, BaseTaskTypeStrategy)
|
||||
|
||||
def test_other_types_still_base(self):
|
||||
"""其他题型仍返回 BaseTaskTypeStrategy。"""
|
||||
for tt in ("Object Recognition", "Temporal Reasoning", "Spatial Reasoning"):
|
||||
s = get_strategy(tt)
|
||||
assert isinstance(s, BaseTaskTypeStrategy), f"{tt} 应该是 BaseTaskTypeStrategy"
|
||||
|
||||
Reference in New Issue
Block a user