feat: 打开 browser_act
This commit is contained in:
1 parent
b1ef4ccb1a
commit
8ed54448c2
5 files changed
+106
-15
No files matched your search
@@ -3,6 +3,7 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import asyncio
|
||||
import logging
|
||||
|
||||
import pytest
|
||||
|
||||
@@ -76,6 +77,22 @@ def test_fetch_task_default_kind_is_fetch():
|
||||
assert claimed["action"] is None
|
||||
|
||||
|
||||
def test_claim_next_browser_task_logs_claim_diagnostics(caplog):
|
||||
task_queue.create_browser_task(user_id="u1", url="https://example.com/1")
|
||||
task_queue.create_browser_task(user_id="u2", url="https://example.com/2")
|
||||
|
||||
with caplog.at_level(logging.INFO, logger=task_queue.__name__):
|
||||
claimed = task_queue.claim_next_browser_task(user_id="u1", worker_id="worker-1")
|
||||
|
||||
assert claimed is not None
|
||||
assert "Browser task claim scan" in caplog.text
|
||||
assert "user_id=u1" in caplog.text
|
||||
assert "worker_id=worker-1" in caplog.text
|
||||
assert "total_files=2" in caplog.text
|
||||
assert "matching_user=1" in caplog.text
|
||||
assert "claimed_task_id=" in caplog.text
|
||||
|
||||
|
||||
# --- tool validation --------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user