mirror of
https://github.com/darkzoul5/YoutubePlaylistSync.git
synced 2026-11-04 15:38:14 +02:00
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:
1 parent
21ba87c501
commit
b5ee8dbf3b
13 files changed
+170
-20
No files matched your search
+16
-16
@@ -1,23 +1,23 @@
|
||||
import logging
|
||||
from ytplaylist.manager import PlaylistManager
|
||||
from tests.temp_config import TempConfig
|
||||
from tests.dummy_config import DummyConfig
|
||||
|
||||
|
||||
class TestConfig(TempConfig):
|
||||
playlists = [{"url": None, "save_path": "./tmp_test", "archive": "archive.txt"}]
|
||||
|
||||
if __name__ == '__main__':
|
||||
def test_run_with_prune_disabled():
|
||||
logging.basicConfig(level=logging.INFO, format="%(levelname)s:%(message)s")
|
||||
print('--- Running with prune=False ---')
|
||||
cfg=TestConfig()
|
||||
m=PlaylistManager(cfg, debug=False)
|
||||
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()
|
||||
print('Run complete prune=False')
|
||||
|
||||
print('\n--- Running with prune=True, non_interactive=True ---')
|
||||
cfg2=TestConfig()
|
||||
cfg2.prune=True
|
||||
cfg2.non_interactive=True
|
||||
m2=PlaylistManager(cfg2, debug=False)
|
||||
m2.run()
|
||||
print('Run complete prune=True non_interactive=True')
|
||||
|
||||
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()
|
||||
Reference in new issue
Block a user