From 469025b6f2983560be0260a38fbbefe4864da35a Mon Sep 17 00:00:00 2001 From: Carlos Garcia Date: Sat, 16 May 2026 18:32:38 -0400 Subject: [PATCH] test: fix bad vendor example in pass2 similarity test 'Restaurant A' vs 'Restaurant Z' differ by 1 char so difflib scores them at ~91% -- correctly above the 80% threshold. Use clearly different vendors (Starbucks Coffee vs McDonalds Burger) instead. Co-Authored-By: Claude Sonnet 4.6 --- tests/test_expenses_agent.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/test_expenses_agent.py b/tests/test_expenses_agent.py index 1f9358e..1d38e63 100644 --- a/tests/test_expenses_agent.py +++ b/tests/test_expenses_agent.py @@ -132,10 +132,11 @@ class TestFindSemanticDuplicate: assert idx == 0 def test_pass2_requires_high_vendor_similarity(self): - """Pass 2 threshold is 80% — a vague vendor name should not trigger it.""" - candidates = [_candidate(_p('Restaurant A', 8.55, '2026-05-09'))] + """Pass 2 threshold is 80% — clearly different vendors should not trigger it.""" + # "Starbucks Coffee" vs "McDonalds Burger" share very few characters (~25%) + candidates = [_candidate(_p('Starbucks Coffee', 8.55, '2026-05-09'))] idx = ExpensesAgent._find_semantic_duplicate( - _p('Restaurant Z', 15.00, '2026-05-09'), candidates) + _p('McDonalds Burger', 15.00, '2026-05-09'), candidates) assert idx is None def test_pass2_same_date_required(self):