From f33b0824fb28327754adcdd4f9550839aa52f564 Mon Sep 17 00:00:00 2001 From: 69049ed6x <69049ed6x@users.noreply.github.com> Date: Sat, 7 Mar 2026 17:07:44 +0800 Subject: [PATCH] test: cover explicit empty rationale --- 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 7f0b6df7..5f306cb1 100644 --- a/tests/test_factor_rules.py +++ b/tests/test_factor_rules.py @@ -253,6 +253,15 @@ class FactorRulesPathTests(unittest.TestCase): self.assertIn("- Conditions: No explicit conditions provided", summary) + def test_summarize_factor_rules_preserves_explicit_empty_rationale(self): + summary = summarize_factor_rules( + [{"name": "Carry", "signal": "neutral", "rationale": ""}], + ticker="XLF", + trade_date="2026-03-07", + ) + + self.assertIn("- Rationale: ", summary) + if __name__ == "__main__": unittest.main()