manga-dlp/tests/test_01_app.py

26 lines
815 B
Python
Raw Normal View History

from pathlib import Path
2022-05-13 22:34:25 +02:00
import mangadlp.app as app
2022-05-11 11:32:29 +02:00
from mangadlp.api.mangadex import Mangadex
2022-05-10 16:38:14 +02:00
def test_readin_list():
2022-05-16 22:03:37 +02:00
list_file = "tests/test_list.txt"
test = app.MangaDLP(readlist=list_file, list_chapters=True)
test.__main__()
test_list = test.url_list
2022-05-10 16:38:14 +02:00
assert test_list == [
"https://mangadex.org/title/a96676e5-8ae2-425e-b549-7f15dd34a6d8/komi-san-wa-komyushou-desu",
"https://mangadex.org/title/bd6d0982-0091-4945-ad70-c028ed3c0917/mushoku-tensei-isekai-ittara-honki-dasu",
"37f5cce0-8070-4ada-96e5-fa24b1bd4ff9",
]
2022-05-11 11:32:29 +02:00
def test_check_api():
2022-05-10 16:38:14 +02:00
url = "https://mangadex.org/title/a96676e5-8ae2-425e-b549-7f15dd34a6d8/komi-san-wa-komyushou-desu"
2022-05-16 22:03:37 +02:00
test = app.MangaDLP(url_uuid=url, list_chapters=True)
test.__main__()
2022-05-16 22:03:37 +02:00
assert test.api_used == Mangadex