-
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 #711 from glensc/pytrakt/shows/progress
- Loading branch information
Showing
6 changed files
with
40 additions
and
21 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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,31 @@ | ||
#!/usr/bin/env python3 -m pytest | ||
from trakt.tv import TVShow | ||
|
||
from plextraktsync.pytrakt_extensions import ShowProgress | ||
from plextraktsync.trakt_api import TraktApi | ||
from tests.conftest import factory | ||
|
||
trakt: TraktApi = factory.trakt_api() | ||
|
||
|
||
def test_trakt_collection_progress(): | ||
show = TVShow('Game of Thrones') | ||
collected = trakt.collected(show) | ||
assert isinstance(collected, ShowProgress) | ||
s01e01 = collected.get_completed(1, 1) | ||
assert isinstance(s01e01, bool) | ||
|
||
|
||
def test_trakt_watched_progress(): | ||
show = TVShow('Game of Thrones') | ||
data = show.watched_progress() | ||
watched = ShowProgress(**data) | ||
|
||
assert isinstance(watched, ShowProgress) | ||
s01e01 = watched.get_completed(1, 1) | ||
assert isinstance(s01e01, bool) | ||
|
||
|
||
if __name__ == '__main__': | ||
test_trakt_collection_progress() | ||
test_trakt_watched_progress() |