feat(fulfillment): 增加工作台状态事件同步

This commit is contained in:
yml
2026-11-18 10:59:20 +08:00
parent 3a8f12ae43
commit 00c4a268c2
10 changed files with 262 additions and 10 deletions
+9 -1
View File
@@ -464,8 +464,15 @@ class TestBindingAndCompletion(_Base):
assert task.issue_code == ""
assert task.last_error == ""
def test_refresh_binding_maps_role_ready(self):
def test_refresh_binding_maps_role_ready(self, monkeypatch):
notified: list[int] = []
monkeypatch.setattr(
service,
"notify_order_site_binding_state_async",
lambda task_id: notified.append(task_id),
)
task = self._allocated()
notified.clear()
bind_task = DouyuTask(
batch_id="bind-1",
account_id=task.account_id,
@@ -487,6 +494,7 @@ class TestBindingAndCompletion(_Base):
assert detail["task"]["bindingStatus"] == "role_ready"
assert detail["task"]["bindTask"]["roleName"] == "测试角色"
assert notified == [task.id]
def test_refresh_binding_clears_stale_failure_when_qr_is_pending(self):
task = self._allocated()