From 70a294c9481d3a1a06e9923cba4df596d578cf61 Mon Sep 17 00:00:00 2001 From: dekun Date: Mon, 27 Jul 2026 15:42:10 +0800 Subject: [PATCH] Restore hold_timing open-position unit test. Co-authored-by: Cursor --- backend/tests/test_hold_timing.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/backend/tests/test_hold_timing.py b/backend/tests/test_hold_timing.py index 141817a..8e7f8bf 100644 --- a/backend/tests/test_hold_timing.py +++ b/backend/tests/test_hold_timing.py @@ -55,6 +55,14 @@ def test_hold_dual_leg_uses_group_close(): assert h["hold_basis"] == "group" +def test_hold_open_no_close(): + g = {"open_at_ms": 100, "close_at_ms": None, "status": "open", "close_reason": None} + h = hold_timing(g, []) + assert h["hold_close_at_ms"] is None + assert h["hold_ms"] is None + assert h["hold_basis"] == "open" + + def test_hold_sqlite_row_like_without_get(): """sqlite3.Row 无 .get,需能转 dict。"""