add basic testing
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Ivan Schaller 2021-12-20 00:29:27 +01:00
parent dd459d1dc2
commit d6ebc3e33a
3 changed files with 20 additions and 2 deletions

5
.gitignore vendored
View file

@ -3,3 +3,8 @@ test.py
mangadexdlp/__pycache__/ mangadexdlp/__pycache__/
test/ test/
downloads/ downloads/
.vscode/
.pytest_cache&
.vscode/
__pycache__/

View file

@ -21,7 +21,7 @@ def mangadex_dlp(md_url='',
lang (str) -- Language to download chapters in. Defaults to "en" -> english\n lang (str) -- Language to download chapters in. Defaults to "en" -> english\n
list (bool) -- If it should only list all available chapters. Defaults to False\n list (bool) -- If it should only list all available chapters. Defaults to False\n
nocbz (bool) -- If the downloaded images should not be packed into a .cbz archive. Defaults to false\n nocbz (bool) -- If the downloaded images should not be packed into a .cbz archive. Defaults to false\n
verbose (bool) -- If verbose logging is enabled verbose (bool) -- If verbose logging is enabled. Defaults to false\n
Returns:\n Returns:\n
nothing\n nothing\n

13
testing.py Normal file
View file

@ -0,0 +1,13 @@
import pytest
import mangadexdlp.api as MdApi
import mangadexdlp.utils as MdUtils
def test_get_uuid():
url = 'https://mangadex.org/title/a96676e5-8ae2-425e-b549-7f15dd34a6d8/komi-san-wa-komyushou-desu'
assert MdApi.get_manga_uuid(url) == 'a96676e5-8ae2-425e-b549-7f15dd34a6d8'
def test_get_chapter_list():
chapters = '1,2,4-6'
assert MdUtils.get_chapter_list(chapters) == ['1', '2', '4', '5', '6']