2018-06-11 09:10:59 -07:00
|
|
|
from anime_downloader import get_anime_class
|
2018-05-30 03:56:27 -07:00
|
|
|
from anime_downloader.sites.nineanime import NineAnime
|
2018-05-27 11:59:51 -07:00
|
|
|
|
|
|
|
import pytest
|
2018-07-13 04:57:08 -07:00
|
|
|
import os
|
2018-05-30 03:56:27 -07:00
|
|
|
|
2019-07-17 07:38:48 -07:00
|
|
|
# @pytest.fixture
|
|
|
|
# def anime(anime_url):
|
|
|
|
# cls = get_anime_class(anime_url)
|
2018-06-11 09:10:59 -07:00
|
|
|
|
2019-07-17 07:38:48 -07:00
|
|
|
# return cls(
|
|
|
|
# anime_url, quality='480p'
|
|
|
|
# )
|
2018-05-27 11:59:51 -07:00
|
|
|
|
|
|
|
|
2019-07-17 07:38:48 -07:00
|
|
|
# def test_length(anime):
|
|
|
|
# assert len(anime) == 12
|
2018-05-27 11:59:51 -07:00
|
|
|
|
|
|
|
|
2019-07-17 07:38:48 -07:00
|
|
|
# def test_title(anime):
|
|
|
|
# assert anime.title.lower() in ['kochinpa!', 'kochin pa!']
|
2018-05-27 11:59:51 -07:00
|
|
|
|
|
|
|
|
2019-07-17 07:38:48 -07:00
|
|
|
# @pytest.mark.skipif(bool(os.environ.get('CI')), reason="Test fails on ci")
|
|
|
|
# def test_episode(anime):
|
|
|
|
# episode1 = anime[0]
|
|
|
|
# assert episode1.stream_url.endswith('.mp4')
|
2018-05-27 12:15:35 -07:00
|
|
|
|
|
|
|
|
2019-07-17 07:38:48 -07:00
|
|
|
# @pytest.mark.skipif(bool(os.environ.get('CI')), reason="Test fails on ci")
|
|
|
|
# def test_download(anime, tmpdir):
|
|
|
|
# eps = (anime[0], anime[6], anime[-1])
|
|
|
|
# for ep in eps:
|
|
|
|
# ep.download(path=str(tmpdir))
|
2018-05-28 12:38:55 -07:00
|
|
|
|
|
|
|
|
2018-10-18 03:17:53 -07:00
|
|
|
# def test_search():
|
|
|
|
# results = NineAnime.search('dragon ball super')
|
2018-05-28 12:38:55 -07:00
|
|
|
|
2018-10-18 03:17:53 -07:00
|
|
|
# assert len(results) == 30
|
|
|
|
# assert results[0].title.lower() in ['dragon ball super', 'dragon ball super movie']
|