test: cover zero factor rule weight

This commit is contained in:
69049ed6x 2026-03-07 18:17:33 +08:00
parent a12ea1fc83
commit 42977a7e00
1 changed files with 9 additions and 0 deletions

View File

@ -282,6 +282,15 @@ class FactorRulesPathTests(unittest.TestCase):
self.assertIn("Rule 1: Rule 1", summary)
self.assertIn("- Signal bias: neutral", summary)
def test_summarize_factor_rules_preserves_zero_weight_value(self):
summary = summarize_factor_rules(
[{"name": "Carry", "signal": "neutral", "weight": 0}],
ticker="USO",
trade_date="2026-03-07",
)
self.assertIn("- Weight: 0", summary)
if __name__ == "__main__":
unittest.main()