From 98afb8c74ece96a93fc94503f56e03e2b364be41 Mon Sep 17 00:00:00 2001 From: DARKZOUL5 Date: Tue, 21 Oct 2025 22:24:49 +0300 Subject: [PATCH] Add test script for PlaylistManager with prune and non-interactive modes --- tests/test_cli_flags.py | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 tests/test_cli_flags.py diff --git a/tests/test_cli_flags.py b/tests/test_cli_flags.py new file mode 100644 index 0000000..def1a3e --- /dev/null +++ b/tests/test_cli_flags.py @@ -0,0 +1,29 @@ +import logging +from ytplaylist.manager import PlaylistManager + +class test: + playlists=[{"url": None, "save_path":"./tmp_test", "archive":"archive.txt"}] + yt_dlp_path="yt-dlp" + ffmpeg_path="ffmpeg" + aria2c_path="aria2c" + max_parallel_downloads=2 + aria2c_connections=2 + debug=False + non_interactive=False + prune=False + +if __name__ == '__main__': + logging.basicConfig(level=logging.INFO, format="%(levelname)s:%(message)s") + print('--- Running with prune=False ---') + cfg=test() + m=PlaylistManager(cfg, debug=False) + m.run() + print('Run complete prune=False') + + print('\n--- Running with prune=True, non_interactive=True ---') + cfg2=test() + cfg2.prune=True + cfg2.non_interactive=True + m2=PlaylistManager(cfg2, debug=False) + m2.run() + print('Run complete prune=True non_interactive=True')