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 <noreply@anthropic.com>
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user