soulsync/tests/sync
Broque Thomas 687bb0ca2c Add tests for next_run reset and lazy candidate pool
`tests/automation/test_automation_api.py` gains three update_automation
tests covering the schedule-shape reset:
- trigger_config change blanks next_run
- trigger_type change blanks next_run
- non-trigger field (name) leaves next_run alone

`tests/sync/test_sync_candidate_pool.py` is new — nine tests for the
lazy artist track pool in PlaylistSyncService:
- candidate_pool=None disables pooling and skips the DB call
- first lookup for an artist fetches and caches
- second lookup for the same artist reuses the cache (zero DB calls)
- empty result still cached so the next call short-circuits without SQL
- defensive None return coerced to []
- search_tracks exception returns None and does NOT poison the cache
- pool key is normalized so casing variants share a single fetch
- different artists get separate pool entries
- server_source plumbing survives the trip to search_tracks

All assertions go through fakes / MagicMock — no real DB, no
web_server.py import, no AST-parsing.
2026-05-24 22:58:48 -07:00
..
__init__.py Persist Find & Add selections as permanent server-playlist match overrides 2026-05-14 09:39:24 -07:00
test_match_overrides.py Persist Find & Add selections as permanent server-playlist match overrides 2026-05-14 09:39:24 -07:00
test_sync_candidate_pool.py Add tests for next_run reset and lazy candidate pool 2026-05-24 22:58:48 -07:00