-
Notifications
You must be signed in to change notification settings - Fork 223
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests: add tests for anistream and animefreak
- Loading branch information
Showing
13 changed files
with
3,902 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import pytest | ||
|
||
from anime_downloader.sites.animefreak import AnimeFreak | ||
from test_sites.site import configure_httpretty | ||
|
||
|
||
@pytest.fixture | ||
def anime(): | ||
return AnimeFreak('https://www.animefreak.tv/watch/shingeki-no-kyojin') | ||
|
||
configure_httpretty('animefreak') | ||
|
||
def test_search(): | ||
ret = AnimeFreak.search('shingeki no kyojin') | ||
assert len(ret) == 24 | ||
assert ret[2].title == 'Shingeki no Kyojin' | ||
|
||
|
||
def test_title(anime): | ||
assert anime.title == '' | ||
|
||
|
||
def test_length(anime): | ||
assert len(anime) == 28 | ||
|
||
|
||
def test_streamurl(anime): | ||
assert anime[0].source().stream_url == 'http://st7.anime1.com/Attack on Titan s1e01_af.mp4?st=orn45gwkj2zr9NbHogG_YA&e=1569695560' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import pytest | ||
|
||
from anime_downloader.sites.anistream import Anistream | ||
from test_sites.site import configure_httpretty | ||
|
||
|
||
@pytest.fixture | ||
def anime(): | ||
return Anistream('https://ww5.anistream.xyz/animes/1146-shingeki-no-kyojin') | ||
|
||
configure_httpretty('anistream') | ||
|
||
def test_search(): | ||
ret = Anistream.search('shingeki%20no%20kyojin') | ||
assert len(ret) == 9 | ||
assert ret[0].title == 'Shingeki no Kyojin' | ||
|
||
|
||
def test_title(anime): | ||
assert anime.title == 'Shingeki no Kyojin' | ||
|
||
|
||
def test_length(anime): | ||
assert len(anime) == 36 | ||
|
||
|
||
def test_streamurl(anime): | ||
assert anime[0].source().stream_url == 'https://mp4.sh/v/45cb7341.mp4?hash=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczpcL1wvbXA0LnNoIiwiYXVkIjoiaHR0cHM6XC9cL21wNC5zaCIsImRhdGEiOnsiaWQiOiI0NWNiNzM0MSIsImlwIjoiMTQuMTM5LjM1LjIzNSJ9LCJpYXQiOjE1Njk2Nzg0MjcsImV4cCI6MTU2OTY3ODQ4N30.dA0wPkLzyJad-ia0v0IkN6YYcguTfKUPUmgNYg7R_oM' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
[{"method": "GET", "url": "https://www.animefreak.tv/search/topSearch?q=shingeki+no+kyojin", "file": "tmpyzcvipj6"}, {"method": "GET", "url": "https://www.animefreak.tv/watch/shingeki-no-kyojin", "file": "tmpc_cf80id"}, {"method": "GET", "url": "https://www.animefreak.tv/watch/shingeki-no-kyojin/episode/episode-1", "file": "tmppyea8ln8"}] |
Oops, something went wrong.