2022-05-20 19:32:36 +02:00
|
|
|
import pytest
|
2022-06-20 13:01:26 +02:00
|
|
|
|
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
|
|
|
|
2021-12-22 10:10:37 +01: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"
|
2022-06-25 14:28:42 +02:00
|
|
|
test = app.MangaDLP(url_uuid=url, list_chapters=True, download_wait=2)
|
2021-12-22 10:10:37 +01:00
|
|
|
|
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"
|
|
|
|
with pytest.raises(ValueError) as e:
|
2022-06-25 14:28:42 +02:00
|
|
|
app.MangaDLP(url_uuid=url, list_chapters=True, download_wait=2)
|
2022-05-20 19:32:36 +02:00
|
|
|
assert e.type == ValueError
|