Commit Graph

2 Commits

Author SHA1 Message Date
ComputerGuru
fdff0a791a test: add apply_schedule() unit tests + pycache gitignore
apply_schedule() was the actual behavioral fix in the prior commit but
shipped without tests. Six new pytest cases now cover its five+ state
combinations:

- manual mode with an existing crontab + live crond pid -> crontab
  removed, SIGHUP sent
- manual mode with no crontab and no pid file -> no-op (function
  returns cleanly)
- real schedule with a live pid -> crontab written, SIGHUP sent
- real schedule with a dead pid (ProcessLookupError) -> crontab written,
  fresh crond spawned, new pid file
- real schedule with no pid file (e.g. container started in manual
  mode, user enables a schedule via UI) -> crontab written, fresh
  crond spawned
- real schedule with a garbage pid file (non-integer contents) ->
  ValueError caught, fresh crond spawned

os.kill and subprocess.Popen are mocked so no real signals fire and no
real processes spawn during tests. CRONTAB_FILE / CROND_PID_FILE are
redirected to tmp paths via monkeypatch.

.gitignore: add __pycache__/, *.pyc, and .pytest_cache/ to prevent
future contributors from accidentally committing test artifacts.
2026-05-31 19:27:34 -07:00
0ffb54e12e Initial commit: YouTube Sync Docker container
- Alpine-based Docker image with yt-dlp
- Configurable channel sync script
- Unraid template for Community Applications
- Automatic scheduling via cron
- Emby/Plex/Jellyfin compatible output structure
2026-05-08 18:52:04 -04:00