From e7f84d725767beab22fd9d4d8c800cbe83bcace0 Mon Sep 17 00:00:00 2001 From: 69049ed6x <69049ed6x@users.noreply.github.com> Date: Sat, 7 Mar 2026 14:46:07 +0800 Subject: [PATCH] test: cover default factor rule conditions --- 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 ed8c8441..92684354 100644 --- a/tests/test_factor_rules.py +++ b/tests/test_factor_rules.py @@ -185,6 +185,16 @@ class FactorRulesPathTests(unittest.TestCase): self.assertIn("- Signal bias: bullish", summary) self.assertIn("- Weight: high", summary) + def test_summarize_factor_rules_defaults_missing_conditions(self): + summary = summarize_factor_rules( + [{"name": "Liquidity", "signal": "neutral", "rationale": "No screen provided"}], + ticker="AMD", + trade_date="2026-03-07", + ) + + self.assertIn("- Conditions: No explicit conditions provided", summary) + self.assertIn("- Rationale: No screen provided", summary) + if __name__ == "__main__": unittest.main()