From 718c3ea4841545dbbe7429919f3b6b32975b0148 Mon Sep 17 00:00:00 2001 From: Ivan Schaller Date: Thu, 19 May 2022 00:25:25 +0200 Subject: [PATCH] fix tests for changes --- tests/test_02_utils.py | 36 ++++++++++++++++++++++++++++++++++++ tests/test_03_downloader.py | 4 ++-- 2 files changed, 38 insertions(+), 2 deletions(-) diff --git a/tests/test_02_utils.py b/tests/test_02_utils.py index 7548b1d..a9a0753 100644 --- a/tests/test_02_utils.py +++ b/tests/test_02_utils.py @@ -3,6 +3,7 @@ from pathlib import Path import pytest +import mangadlp.app as app import mangadlp.utils as utils @@ -46,6 +47,41 @@ def test_chapter_list_forcevol(): assert utils.get_chapter_list(chapters_in) == chapters_out +def test_chapter_list_full(): + mdlp = app.MangaDLP( + url_uuid="https://mangadex.org/title/0aea9f43-d4a9-4bf7-bebc-550a512f9b95/shikimori-s-not-just-a-cutie", + language="en", + chapters="", + readlist="", + list_chapters=True, + file_format="cbz", + forcevol=True, + download_path="tests", + download_wait=0.5, + verbose=True, + ) + mdlp.__main__() + chap_list = utils.get_chapter_list("1:1,1:2,1:4-1:7,2:", mdlp.manga_chapter_list) + assert chap_list == [ + "1:1", + "1:2", + "1:4", + "1:5", + "1:6", + "1:7", + "2:17", + "2:18", + "2:19", + "2:20", + "2:21", + "2:22", + "2:23", + "2:24", + "2:25", + "2:26", + ] + + def test_fix_name(): filename_in1 = r"..hello?; @test1-*<\>test2.cbz.." filename_in2 = r"!hello: >test1-/test2