-
Notifications
You must be signed in to change notification settings - Fork 113
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #215 from glensc/tvshow-type
Add test for episode lookup
- Loading branch information
Showing
1 changed file
with
21 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,21 @@ | ||
#!/usr/bin/env python3 -m pytest | ||
from plex_trakt_sync.plex_api import PlexLibraryItem | ||
from plex_trakt_sync.trakt_api import TraktApi | ||
|
||
|
||
def make(cls=None, **kwargs): | ||
cls = cls if cls is not None else "object" | ||
# https://stackoverflow.com/a/2827726/2314626 | ||
return type(cls, (object,), kwargs) | ||
|
||
|
||
trakt = TraktApi() | ||
|
||
|
||
def test_tv_lookup(): | ||
m = PlexLibraryItem(make(cls='plexapi.video.Show', guid='imdb://tt10584350', type='show', media_type='shows')) | ||
tm = trakt.find_movie(m) | ||
lookup = trakt.lookup(tm) | ||
te = lookup[1][2].instance | ||
|
||
assert te.imdb == 'tt12057922', f"Unexpected! {te}" |