Refactor test configurations and enhance testing framework

- Replace TempConfig with DummyConfig across tests for consistency
- Introduce unit tests workflow configuration
- Add pytest configuration for standardized test discovery
- Implement comprehensive tests for config loading and downloader behavior
- Clean up unused temp_config.py and related references
This commit is contained in:
2025-11-24 11:21:32 +02:00
parent 21ba87c501
commit b5ee8dbf3b
13 changed files with 170 additions and 20 deletions
@@ -0,0 +1,23 @@
import logging
from ytplaylist.manager import PlaylistManager
from tests.dummy_config import DummyConfig
def test_run_with_prune_disabled():
logging.basicConfig(level=logging.INFO, format="%(levelname)s:%(message)s")
cfg = DummyConfig()
cfg.playlists = [{"url": None, "save_path": "tests/tmp_test", "archive": "archive.txt"}]
m = PlaylistManager(cfg, debug=False)
# should complete without raising
m.run()
def test_run_with_prune_enabled_non_interactive():
logging.basicConfig(level=logging.INFO, format="%(levelname)s:%(message)s")
cfg = DummyConfig()
cfg.playlists = [{"url": None, "save_path": "tests/tmp_test", "archive": "archive.txt"}]
cfg.prune = True
cfg.non_interactive = True
m = PlaylistManager(cfg, debug=False)
# should complete without raising
m.run()