Skip to content

Commit

Permalink
Merge pull request #215 from glensc/tvshow-type
Browse files Browse the repository at this point in the history
Add test for episode lookup
  • Loading branch information
glensc authored Apr 12, 2021
2 parents 56e3f2c + 32f64a6 commit b969b1c
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tests/test_tv_lookup.py
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}"

0 comments on commit b969b1c

Please sign in to comment.