From dcb17ea19bed9d4f90fd0e06c04d55d2a067efac Mon Sep 17 00:00:00 2001 From: 69049ed6x <69049ed6x@users.noreply.github.com> Date: Sat, 7 Mar 2026 19:17:44 +0800 Subject: [PATCH] test: cover empty factor rule conditions entries --- tests/test_factor_rules.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/test_factor_rules.py b/tests/test_factor_rules.py index 95ab1fba..f488135a 100644 --- a/tests/test_factor_rules.py +++ b/tests/test_factor_rules.py @@ -318,6 +318,15 @@ class FactorRulesPathTests(unittest.TestCase): self.assertIn("- Conditions: ('threshold', 5)", summary) + def test_summarize_factor_rules_preserves_empty_condition_entries(self): + summary = summarize_factor_rules( + [{"name": "Carry", "signal": "neutral", "conditions": ["", "macro-ok"]}], + ticker="IEF", + trade_date="2026-03-07", + ) + + self.assertIn("- Conditions: ; macro-ok", summary) + def test_summarize_factor_rules_preserves_empty_string_condition_entries(self): summary = summarize_factor_rules( [{"name": "Carry", "signal": "neutral", "conditions": ["", "fallback"]}],