From 9697d8f9267ec0711877b2d0ea818e8a24d96352 Mon Sep 17 00:00:00 2001 From: 69049ed6x <69049ed6x@users.noreply.github.com> Date: Sat, 7 Mar 2026 15:35:17 +0800 Subject: [PATCH] test: cover default factor rule thesis --- tests/test_factor_rules.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/test_factor_rules.py b/tests/test_factor_rules.py index a2a11ff0..76ac6b65 100644 --- a/tests/test_factor_rules.py +++ b/tests/test_factor_rules.py @@ -204,6 +204,16 @@ class FactorRulesPathTests(unittest.TestCase): self.assertIn("- Conditions: 1; True; 3.14", summary) + def test_summarize_factor_rules_defaults_missing_thesis_to_empty_string(self): + summary = summarize_factor_rules( + [{"name": "Sentiment", "signal": "bullish", "rationale": "Momentum improving"}], + ticker="AMZN", + trade_date="2026-03-07", + ) + + self.assertIn("- Thesis: ", summary) + self.assertIn("- Rationale: Momentum improving", summary) + if __name__ == "__main__": unittest.main()