ver0.1
This commit is contained in:
@@ -463,3 +463,29 @@ async def test_resolve_already_resolved_status() -> None:
|
||||
"123456", pid, chosen_label="纱布", rejected=False
|
||||
)
|
||||
assert excinfo.value.code == "CONFIRMATION_ALREADY_RESOLVED"
|
||||
|
||||
|
||||
def test_pending_queue_pending_count_fifo() -> None:
|
||||
settings = Settings()
|
||||
mgr = CameraSessionManager(
|
||||
settings=settings,
|
||||
vision_algorithm=MagicMock(),
|
||||
hikvision_runtime=None,
|
||||
result_repository=None,
|
||||
)
|
||||
st = SurgerySessionState(candidate_consumables=["纱布"])
|
||||
for pid in ("p1", "p2"):
|
||||
st.pending_by_id[pid] = PendingConsumableConfirmation(
|
||||
id=pid,
|
||||
status="pending",
|
||||
options=[("纱布", 0.4)],
|
||||
prompt_text="x",
|
||||
created_at=datetime.now(timezone.utc),
|
||||
model_top1_label="x",
|
||||
model_top1_confidence=0.4,
|
||||
)
|
||||
st.pending_fifo.append(pid)
|
||||
mgr._registry._active["123456"] = RunningSurgery(
|
||||
stop_event=asyncio.Event(), state=st, tasks=[]
|
||||
)
|
||||
assert mgr.pending_queue_pending_count("123456") == 2
|
||||
|
||||
Reference in New Issue
Block a user