manga-dlp/tests/test_01_app.py

19 lines
553 B
Python
Raw Normal View History

2022-05-20 19:32:36 +02:00
import pytest
2022-06-20 13:01:26 +02:00
2022-05-11 11:32:29 +02:00
from mangadlp.api.mangadex import Mangadex
2023-02-11 15:18:56 +01:00
from mangadlp.app import MangaDLP
2022-05-10 16:38:14 +02:00
2022-05-20 19:32:36 +02:00
def test_check_api_mangadex():
2022-05-10 16:38:14 +02:00
url = "https://mangadex.org/title/a96676e5-8ae2-425e-b549-7f15dd34a6d8/komi-san-wa-komyushou-desu"
2023-02-11 15:18:56 +01:00
test = MangaDLP(url_uuid=url, list_chapters=True, download_wait=2)
2022-05-16 22:03:37 +02:00
assert test.api_used == Mangadex
2022-05-20 19:32:36 +02:00
def test_check_api_none():
url = "https://abc.defghjk/title/abc/def"
2023-02-12 02:25:09 +01:00
with pytest.raises(ValueError) as e:
2023-02-11 15:18:56 +01:00
MangaDLP(url_uuid=url, list_chapters=True, download_wait=2)
2023-02-12 02:25:09 +01:00
assert e.type == ValueError