feat(app): add PoolStrategy Protocol to application ports
This commit is contained in:
@@ -65,3 +65,26 @@ def test_plain_object_does_not_satisfy() -> None:
|
||||
assert not isinstance(object(), LLMProvider)
|
||||
assert not isinstance(object(), VLMProvider)
|
||||
assert not isinstance(object(), TelemetryRecorder)
|
||||
|
||||
|
||||
from app.ports import PoolStrategy
|
||||
|
||||
|
||||
class TestPoolStrategyProtocol:
|
||||
"""PoolStrategy Protocol runtime_checkable 验证。"""
|
||||
|
||||
def test_pool_strategy_is_runtime_checkable(self) -> None:
|
||||
"""PoolStrategy 支持 isinstance 检查。"""
|
||||
from app.harness.pools import Pools
|
||||
|
||||
class FakeStrategy:
|
||||
def build(self, questions, correctness, config):
|
||||
return Pools(
|
||||
diagnosis=[], validation=[], test=[],
|
||||
baseline_run_id="", baseline_val_accuracy=0.0,
|
||||
)
|
||||
|
||||
def build_incremental(self, new_task_types, questions, correctness, config):
|
||||
return {}
|
||||
|
||||
assert isinstance(FakeStrategy(), PoolStrategy)
|
||||
|
||||
Reference in New Issue
Block a user