Hide SIM label in WeCom; count completed rounds from closed groups.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-07-29 18:15:09 +08:00
parent 71b5fcae79
commit 55109e82d3
4 changed files with 39 additions and 10 deletions
+8 -1
View File
@@ -10,13 +10,20 @@ def test_enter_rest_after_close_sets_resting(tmp_path) -> None:
db = Database(tmp_path / "rest.db")
set_db(db)
db.set_setting("rest_seconds", "120")
now = int(time.time() * 1000)
db.execute(
"""INSERT INTO groups(
group_id, status, open_at_ms, close_at_ms, realized_pnl
) VALUES (?,?,?,?,?)""",
("G-20260729-01", "closed", now - 1000, now, 1.0),
)
eng = StrategyEngine()
before = int(time.time() * 1000)
eng.enter_rest_after_close()
row = db.fetchone("SELECT * FROM strategy_state WHERE id=1")
assert row is not None
assert row["phase"] == "resting"
assert int(row["rounds_done"] or 0) >= 1
assert int(row["rounds_done"] or 0) == 1
until = int(row["rest_until_ms"] or 0)
assert until >= before + 100_000
db.close()