manga-dlp/tests/test_04_input.py
Ivan Schaller 38339a4d44
Some checks failed
ci/woodpecker/push/tests Pipeline was successful
ci/woodpecker/pr/tests Pipeline was successful
ci/woodpecker/pr/build_docker Pipeline failed
preperation for 2.1.0
2022-05-16 16:17:55 +02:00

51 lines
1.9 KiB
Python

from pathlib import Path
import pytest
import requests
import mangadlp.input as input
import os
def test_read_and_url():
url_uuid = "https://mangadex.org/title/0aea9f43-d4a9-4bf7-bebc-550a512f9b95/shikimori-s-not-just-a-cutie"
link_file = "tests/testfile.txt"
language = "en"
chapters = "1"
file_format = "cbz"
download_path = "tests"
command_args = f"-u {url_uuid} --read {link_file} -l {language} -c {chapters} --path {download_path} --format {file_format} --verbose"
script_path = "manga-dlp.py"
assert os.system(f"python3 {script_path} {command_args}") != 0
def test_no_read_and_url():
url_uuid = "https://mangadex.org/title/0aea9f43-d4a9-4bf7-bebc-550a512f9b95/shikimori-s-not-just-a-cutie"
link_file = "tests/testfile.txt"
language = "en"
chapters = "1"
file_format = "cbz"
download_path = "tests"
command_args = f"-l {language} -c {chapters} --path {download_path} --format {file_format} --verbose"
script_path = "manga-dlp.py"
assert os.system(f"python3 {script_path} {command_args}") != 0
def test_no_chaps():
url_uuid = "https://mangadex.org/title/0aea9f43-d4a9-4bf7-bebc-550a512f9b95/shikimori-s-not-just-a-cutie"
language = "en"
chapters = ""
file_format = "cbz"
download_path = "tests"
command_args = f"-u {url_uuid} -l {language} --path {download_path} --format {file_format} --verbose"
script_path = "manga-dlp.py"
assert os.system(f"python3 {script_path} {command_args}") != 0
def test_no_volume():
url_uuid = "https://mangadex.org/title/0aea9f43-d4a9-4bf7-bebc-550a512f9b95/shikimori-s-not-just-a-cutie"
language = "en"
chapters = "1"
file_format = "cbz"
download_path = "tests"
command_args = f"-u {url_uuid} -l {language} -c {chapters} --path {download_path} --format {file_format} --verbose --forcevol"
script_path = "manga-dlp.py"
assert os.system(f"python3 {script_path} {command_args}") != 0