单测断言按流的倒序修正
This commit is contained in:
parent
0c8d2a7d6c
commit
9b525be3b8
|
|
@ -125,8 +125,10 @@ def test_parse_sources():
|
||||||
"trigger_time": _today_ms(10, 31)})]
|
"trigger_time": _today_ms(10, 31)})]
|
||||||
rows, n, _t = us._bycode_intraday(_FakeRedis({"intraday_signals:%s" % ymd: itd}), ymd, "601126.SH", 5000)
|
rows, n, _t = us._bycode_intraday(_FakeRedis({"intraday_signals:%s" % ymd: itd}), ymd, "601126.SH", 5000)
|
||||||
assert n == 3 and len(rows) == 2, (n, len(rows))
|
assert n == 3 and len(rows) == 2, (n, len(rows))
|
||||||
assert rows[0]["src"] == "decision" and rows[0]["time"] == "10:04" and rows[0]["confidence"] == 0.95
|
# 流是倒序读的, 所以 10:30 的择时层那条在前
|
||||||
assert rows[1]["src"] == "timing" and rows[1]["entry_score"] == 78.0, rows[1]
|
assert rows[0]["src"] == "timing" and rows[0]["entry_score"] == 78.0, rows[0]
|
||||||
|
assert rows[1]["src"] == "decision" and rows[1]["time"] == "10:04" and rows[1]["confidence"] == 0.95, rows[1]
|
||||||
|
assert rows[1]["cat_label"] == "建议买入" and rows[1]["price"] == 43.15
|
||||||
|
|
||||||
old = _today_ms(9, 35)
|
old = _today_ms(9, 35)
|
||||||
with _Patch() as p:
|
with _Patch() as p:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue