feat(data): akshare事件类扩涨停池三件套——daily_stock_analysis调研落地第一步;双机实测(Mac+VPS生产IP)分流:push2ex集群(zt_pool/zbgc/dtgc)连打多轮全稳可用,push2 clist集群(行业/概念榜/板块资金流/主力资金)与push2his(cyq筹码/个股资金流)每IP长窗暗配额(首发200第二发起全reset,30s/镜像轮换/换头均不过)判敌对弃采;zt_pool 83只/zbgc 6只/dtgc 2只真实行数实证,dtgc空数据=当日真无跌停走既有写空+done语义;三类型进PER_DATE_TYPES家族(ak-events 19:30同窗+3单次调用<1min),零新schtask零新目录零新依赖;+4测试(注册/None契约/df契约/真空df落盘) [vps]
CI/CD / test (push) Successful in 4s
CI/CD / nas-deploy (push) Successful in 13s
CI/CD / nas-verify (push) Successful in 14s

This commit is contained in:
2026-09-02 08:07:31 +08:00
parent de9efec87e
commit db789d6e9c
3 changed files with 72 additions and 3 deletions
@@ -99,3 +99,37 @@ class TestFailedNoOverwrite:
lambda *a, **k: (df, "ok"))
assert mod.fetch_income_sheet("SH600519") is df
assert mod.fetch_express("20260630") is df
class TestZtPoolFamily:
"""涨停池三件套 (2026-09-02 双机实测入列, push2ex 集群)。"""
def test_registered_as_per_date_types(self):
for t in ("zt_pool", "zt_pool_zbgc", "zt_pool_dtgc"):
assert t in mod.PER_DATE_TYPES
assert t in mod.ALL_TYPES
def test_fetchers_none_on_retry_exhausted(self, monkeypatch):
monkeypatch.setattr(
mod, "call_ak_with_retry", lambda *a, **k: (None, "failed"))
assert mod.fetch_zt_pool("20260901") is None
assert mod.fetch_zt_pool_zbgc("20260901") is None
assert mod.fetch_zt_pool_dtgc("20260901") is None
def test_fetchers_df_on_ok(self, monkeypatch):
df = pd.DataFrame({"连板数": [3]})
monkeypatch.setattr(mod, "call_ak_with_retry",
lambda *a, **k: (df, "ok"))
assert mod.fetch_zt_pool("20260901") is df
assert mod.fetch_zt_pool_zbgc("20260901") is df
assert mod.fetch_zt_pool_dtgc("20260901") is df
def test_empty_dtgc_day_writes_empty_and_marks(self, tmp_path, monkeypatch):
"""跌停池 0 跌停日 = 真空 df → 写空 + done (复跑不重拉)。"""
monkeypatch.setattr(mod, "OUT_DIR", tmp_path)
status, _ = mod.download_one_unit(
"zt_pool_dtgc", "20260901_zt_pool_dtgc",
lambda: pd.DataFrame(), force=True)
assert status == "empty"
assert (tmp_path / "zt_pool_dtgc" / "20260901_zt_pool_dtgc.parquet").exists()
assert (tmp_path / "zt_pool_dtgc" / ".20260901_zt_pool_dtgc.akshare").exists()