soulsync/tests/automation
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 Lift /api/automations/* into core/automation/ 2026-04-27 18:05:14 -07:00
test_automation_api.py Add tests for next_run reset and lazy candidate pool 2026-05-24 22:58:48 -07:00
test_automation_blocks.py Personalized pipeline: UI multi-select picker for kinds + variants 2026-05-15 19:33:34 -07:00
test_automation_progress.py Lift /api/automations/* into core/automation/ 2026-04-27 18:05:14 -07:00
test_automation_signals.py Lift /api/automations/* into core/automation/ 2026-04-27 18:05:14 -07:00
test_handler_error_storage.py Harden playlist pipeline source refresh 2026-05-24 19:31:00 -07:00
test_handler_registration.py Personalized playlist pipeline: auto-sync discover-page playlists 2026-05-15 18:41:08 -07:00
test_handlers_maintenance.py Personalized playlist pipeline: auto-sync discover-page playlists 2026-05-15 18:41:08 -07:00
test_handlers_personalized_pipeline.py Preserve personalized playlist metadata for wishlist 2026-05-15 21:50:32 -07:00
test_handlers_playlist.py Add direct mirrored playlist pipeline runs 2026-05-24 19:54:04 -07:00
test_handlers_simple.py Add direct mirrored playlist pipeline runs 2026-05-24 19:54:04 -07:00
test_progress_callbacks.py Personalized playlist pipeline: auto-sync discover-page playlists 2026-05-15 18:41:08 -07:00