-
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
807287e
commit 215ae9d
Showing
1 changed file
with
34 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
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_network, expected_title", [ | ||
("Nocturnal Animals 2016 VFF 1080p BluRay DTS HEVC-HD2", None, "Nocturnal Animals"), | ||
("doctor_who_2005.8x12.death_in_heaven.720p_hdtv_x264-fov", None, "doctor who"), | ||
("The Vet Life S02E01 Dunk-A-Doctor 1080p ANPL WEB-DL AAC2 0 H 264-RTN", "Animal Planet", "The Vet Life"), | ||
("Gotham S03E17 XviD-AFG", None, "Gotham"), | ||
("Jimmy Kimmel 2017 05 03 720p HDTV DD5 1 MPEG2-CTL", None, "Jimmy Kimmel"), | ||
("[Anime Time] Re Zero kara Hajimeru Isekai Seikatsu (Season 2 Part 1) [1080p][HEVC10bit x265][Multi Sub]", None, "Re Zero kara Hajimeru Isekai Seikatsu"), | ||
("[naiyas] Fate Stay Night - Unlimited Blade Works Movie [BD 1080P HEVC10 QAACx2 Dual Audio]", None, "Fate Stay Night - Unlimited Blade Works Movie"), | ||
]) | ||
def test_codec_detection(parser, release_name, expected_network, expected_title): | ||
result = parser.parse(release_name) | ||
if expected_network: | ||
assert "network" in result, f"network key missing in result for {release_name}" | ||
assert result["network"] == expected_network, f"Incorrect network detected for {release_name}" | ||
else: | ||
assert "network" not in result, f"Unexpected network detection for {release_name}" | ||
if expected_title: | ||
assert "title" in result, f"title key missing in result for {release_name}" | ||
assert result["title"] == expected_title, f"Incorrect title detected for {release_name}" | ||
else: | ||
assert "title" not in result, f"Unexpected title detection for {release_name}" |