test: cover default factor rule weight

This commit is contained in:
69049ed6x 2026-03-07 15:54:37 +08:00
parent 9697d8f926
commit 2baa92251d
1 changed files with 10 additions and 0 deletions

View File

@ -214,6 +214,16 @@ class FactorRulesPathTests(unittest.TestCase):
self.assertIn("- Thesis: ", summary)
self.assertIn("- Rationale: Momentum improving", summary)
def test_summarize_factor_rules_defaults_missing_weight_to_medium(self):
summary = summarize_factor_rules(
[{"name": "Value", "signal": "bullish", "thesis": "Cheap relative to peers"}],
ticker="NFLX",
trade_date="2026-03-07",
)
self.assertIn("- Weight: medium", summary)
self.assertIn("- Thesis: Cheap relative to peers", summary)
if __name__ == "__main__":
unittest.main()