Test parsing of new tv agent
ADD
tests/test_new_agent.py
+#!/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='plex://show/5d9c085ae98e47001eb0d74f',
+ guids=[
+ make(id='imdb://tt2661044'),
+ make(id='tmdb://48866'),
+ make(id='tvdb://268592'),
+ ],
+ type='show',
+ ))
+
+ assert m.provider == 'imdb'
+ assert m.id == 'tt2661044'
+ assert m.media_type == 'show'

Test parsing of new tv agent