refactor(douyu): 完成阶段5旧链路清理

This commit is contained in:
yml
2026-11-22 21:40:53 +08:00
parent 94de1d167b
commit 5393b668e0
20 changed files with 155 additions and 559 deletions
+16
View File
@@ -411,6 +411,8 @@ class TestOverviewAggregation:
assert seen == ["ELITE-M"], "商城商品必须用精英宝典的 manualID 拉"
assert "esports" in r["errors"] # 电竞那一项照常报未配置
assert r["limited_goods_total"] == 2
assert r["limited_count"] == 1
assert len(r["limited_goods"]) == 1
# 高价值三态照样落库(官方 status 说了算)
self.session.commit()
self.session.refresh(self.account)
@@ -547,6 +549,8 @@ class TestOverviewAggregation:
assert result["goods_source"] == "local_fresh_projection"
assert result["pending_domains"] == []
assert result["limited_goods_total"] == 1
assert result["limited_count"] == 0
assert result["limited_goods"] == []
assert self.session.query(AccountWorkItem).count() == 0
def test_stale_esports_and_exchange_records_use_local_projection_and_queue(self):
@@ -613,6 +617,18 @@ class TestOverviewTaskTypeWiring:
for scope in ("elite", "esports", "peace"):
assert "query_account_overview" in DOUYU_HANDBOOK_TASK_TYPES[scope]
def test_obsolete_goods_tasks_are_not_supported(self):
from web.backend.services.douyu_service import (
DOUYU_HANDBOOK_TASK_TYPES,
SUPPORTED_DOUYU_TASK_TYPES,
)
assert "refresh_goods" not in SUPPORTED_DOUYU_TASK_TYPES
assert "query_limited_goods" not in SUPPORTED_DOUYU_TASK_TYPES
for scope in ("elite", "esports", "peace"):
assert "refresh_goods" not in DOUYU_HANDBOOK_TASK_TYPES[scope]
assert "query_limited_goods" not in DOUYU_HANDBOOK_TASK_TYPES[scope]
def test_handler_is_dispatched(self):
from web.backend.services.douyu_runner import DouyuBatchRunner