1212import pytest
1313
1414from paperscout .errors import ConfigurationError
15- from paperscout .models import CycleResult , CycleStatus , Paper , PerUserMatches , ProbeHit
15+ from paperscout .models import CycleResult , CycleStatus , MatchReason , Paper , PerUserMatches , ProbeHit
1616from paperscout .monitor import (
1717 DiffResult ,
1818 PollResult ,
@@ -189,7 +189,7 @@ def test_explicit_dp_transitions(self):
189189 def test_explicit_per_user_matches (self ):
190190 diff = DiffResult (new_papers = [], updated_papers = [])
191191 paper = Paper (id = "P2300R11" )
192- pum = PerUserMatches (papers = [(paper , "author" )], probe_hits = [])
192+ pum = PerUserMatches (papers = [(paper , MatchReason . AUTHOR )], probe_hits = [])
193193 result = PollResult (diff = diff , probe_hits = [], per_user_matches = {"U1" : pum })
194194 assert "U1" in result .per_user_matches
195195
@@ -358,7 +358,7 @@ async def test_poll_once_populates_per_user_matches(self, fake_pool):
358358 prober .run_cycle = AsyncMock (return_value = _empty_cycle ())
359359
360360 user_watchlist .matches_for_users .return_value = {
361- "U123" : PerUserMatches (papers = [(new_paper , "author" )], probe_hits = [])
361+ "U123" : PerUserMatches (papers = [(new_paper , MatchReason . AUTHOR )], probe_hits = [])
362362 }
363363 result = await scheduler .poll_once ()
364364 assert "U123" in result .per_user_matches
@@ -373,7 +373,7 @@ async def test_poll_once_per_user_probe_hit(self, fake_pool):
373373 index .papers = {}
374374
375375 user_watchlist .matches_for_users .return_value = {
376- "U123" : PerUserMatches (papers = [], probe_hits = [(hit , "author" )])
376+ "U123" : PerUserMatches (papers = [], probe_hits = [(hit , MatchReason . AUTHOR )])
377377 }
378378 result = await scheduler .poll_once ()
379379 assert "U123" in result .per_user_matches
@@ -403,7 +403,7 @@ async def test_restart_with_prior_poll_notifies_seed_hits(self, fake_pool):
403403 hit = _recent_hit ()
404404 prober .run_cycle = AsyncMock (return_value = _success_cycle ([hit ]))
405405 user_watchlist .matches_for_users .return_value = {
406- "U123" : PerUserMatches (papers = [], probe_hits = [(hit , "author" )])
406+ "U123" : PerUserMatches (papers = [], probe_hits = [(hit , MatchReason . AUTHOR )])
407407 }
408408 result = await scheduler .poll_once ()
409409 assert len (notified ) == 1
@@ -418,7 +418,7 @@ async def test_restart_with_discovered_urls_notifies(self, fake_pool):
418418 hit = _recent_hit ()
419419 prober .run_cycle = AsyncMock (return_value = _success_cycle ([hit ]))
420420 user_watchlist .matches_for_users .return_value = {
421- "U123" : PerUserMatches (papers = [], probe_hits = [(hit , "author" )])
421+ "U123" : PerUserMatches (papers = [], probe_hits = [(hit , MatchReason . AUTHOR )])
422422 }
423423 result = await scheduler .poll_once ()
424424 assert len (notified ) == 1
0 commit comments