单测的风控卖出流用真实毫秒当流 id

This commit is contained in:
zlt 2026-09-09 14:55:17 +08:00
parent 9b525be3b8
commit 7e46d49cfc
1 changed files with 3 additions and 1 deletions

View File

@ -144,7 +144,9 @@ def test_parse_sources():
unknown = [r for r in arows if not r["stale"]][0] unknown = [r for r in arows if not r["stale"]][0]
assert unknown["cat"] == "other" and unknown["direction"] == "看跌", unknown assert unknown["cat"] == "other" and unknown["direction"] == "看跌", unknown
sell = [("1-0", {"data": '{"ts_code": "601126.SH", "action": "SELL", "confidence": 0.8,' # 不分键的流要用真实毫秒当流 id (Redis 自动生成的 id 毫秒就是写入时刻),
# 否则会被"扫到今天零点为止"直接截掉 —— 这正是那道截断在起作用。
sell = [("%d-0" % _today_ms(14, 10), {"data": '{"ts_code": "601126.SH", "action": "SELL", "confidence": 0.8,'
' "dominant_signal": "BREAK_DOWN", "llm_reason": "跌破支撑",' ' "dominant_signal": "BREAK_DOWN", "llm_reason": "跌破支撑",'
' "timestamp": %d}' % _today_ms(14, 10)})] ' "timestamp": %d}' % _today_ms(14, 10)})]
srows, _n, _t = us._bycode_sell(_FakeRedis({"bionic:signals:llm_sell_actions": sell}), "601126.SH", 5000) srows, _n, _t = us._bycode_sell(_FakeRedis({"bionic:signals:llm_sell_actions": sell}), "601126.SH", 5000)