完善模板,加入RPA标准
This commit is contained in:
24
scripts/service/example_adapter/mock.py
Normal file
24
scripts/service/example_adapter/mock.py
Normal file
@@ -0,0 +1,24 @@
|
||||
"""离线 mock 档位:纯内存仿真,CI / 单测必跑。"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from .base import AdapterBase, ExampleItem, ExampleResult
|
||||
|
||||
|
||||
class MockAdapter(AdapterBase):
|
||||
name = "mock"
|
||||
|
||||
def do_batch(self, target: str, items: list[ExampleItem]) -> ExampleResult:
|
||||
if not items:
|
||||
return ExampleResult(
|
||||
ok=False,
|
||||
serial_no=None,
|
||||
error_msg="empty batch",
|
||||
artifacts={},
|
||||
)
|
||||
return ExampleResult(
|
||||
ok=True,
|
||||
serial_no=f"MOCK-{len(items)}",
|
||||
error_msg=None,
|
||||
artifacts={"mode": "mock", "target": target, "count": len(items)},
|
||||
)
|
||||
Reference in New Issue
Block a user