-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4ec4a0a
commit 643ef01
Showing
3 changed files
with
99 additions
and
0 deletions.
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,49 @@ | ||
import pytest | ||
|
||
from PTT import parse_title | ||
|
||
|
||
@pytest.mark.parametrize("release_name, expected", [ | ||
("Sword.Art.Online.Alternative.S01.v2.1080p.Blu-Ray.10-Bit.Dual-Audio.LPCM.x265-iAHD", { | ||
"title": "Sword Art Online Alternative: Gun Gale Online", | ||
"seasons": [1], | ||
"episodes": [], | ||
"languages": ["dual audio"], | ||
"bit_depth": "10bit", | ||
"dubbed": True, | ||
"quality": "BluRay", | ||
"codec": "x265", | ||
"resolution": "1080p", | ||
"group": "iAHD", | ||
}), | ||
("[SubsPlease] Tearmoon Teikoku Monogatari - 01 (1080p) [15ADAE00].mkv", { | ||
"title": "Tearmoon Teikoku Monogatari", | ||
"seasons": [], | ||
"episodes": [1], | ||
"episode_code": "15ADAE00", | ||
"languages": [], | ||
"resolution": "1080p", | ||
"group": "SubsPlease", | ||
"container": "mkv", | ||
"extension": "mkv", | ||
}), | ||
("[Erai-raws] Tearmoon Teikoku Monogatari - 01 [1080p][Multiple Subtitle] [ENG][POR-BR][SPA-LA][SPA][ARA][FRE][GER][ITA][RUS]", { | ||
"title": "Tearmoon Teikoku Monogatari", | ||
"seasons": [], | ||
"episodes": [1], | ||
"languages": ["multi subs", "english", "french", "spanish", "portuguese", "italian", "german", "russian", "arabic"], | ||
"resolution": "1080p", | ||
"group": "Erai-raws", | ||
}), | ||
("Hunter x Hunter (2011) - 01 [1080p][Multiple Subtitle] [ENG][POR-BR][SPA-LA][SPA][ARA][FRE][GER][ITA][RUS]", { | ||
"title": "Hunter x Hunter", | ||
"seasons": [], | ||
"episodes": [1], | ||
"languages": ["multi subs", "english", "french", "spanish", "portuguese", "italian", "german", "russian", "arabic"], | ||
"resolution": "1080p", | ||
"year": 2011, | ||
}), | ||
]) | ||
def test_random_anime_parse(release_name, expected): | ||
result = parse_title(release_name) | ||
assert result == expected |
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,46 @@ | ||
import pytest | ||
|
||
from PTT.handlers import add_defaults | ||
from PTT.parse import Parser | ||
|
||
|
||
@pytest.fixture | ||
def parser(): | ||
p = Parser() | ||
add_defaults(p) | ||
return p | ||
|
||
|
||
@pytest.mark.parametrize("release_name, expected", [ | ||
("UFC.239.PPV.Jones.Vs.Santos.HDTV.x264-PUNCH[TGx]", { | ||
"title": "UFC 239 Jones Vs Santos", | ||
"seasons": [], | ||
"episodes": [], | ||
"languages": [], | ||
"quality": "HDTV", | ||
"codec": "x264", | ||
"group": "PUNCH", | ||
"ppv": True, | ||
}), | ||
("UFC.Fight.Night.158.Cowboy.vs.Gaethje.WEB.x264-PUNCH[TGx]", { | ||
"title": "UFC Fight Night 158 Cowboy vs Gaethje", | ||
"seasons": [], | ||
"episodes": [], | ||
"languages": [], | ||
"quality": "WEB-DL", | ||
"codec": "x264", | ||
"group": "PUNCH", | ||
"ppv": True, | ||
}), | ||
("UFC 226 PPV Miocic vs Cormier HDTV x264-Ebi [TJET]", { | ||
"title": "UFC 226 Miocic vs Cormier", | ||
"seasons": [], | ||
"episodes": [], | ||
"languages": [], | ||
"quality": "HDTV", | ||
"codec": "x264", | ||
"ppv": True, | ||
}) | ||
]) | ||
def test_random_sports_parse(parser, release_name, expected): | ||
assert parser.parse(release_name) == expected |