Skip to content

Commit

Permalink
Merge remote-tracking branch 'remotes/origin/master' into clean_optimize
Browse files Browse the repository at this point in the history
  • Loading branch information
blacktwin committed Oct 23, 2020
2 parents b8fbe72 + 8ec0c4c commit 5db6f49
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
2 changes: 2 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,8 @@ def patched_http_call(mocker):
# Utility Functions
# ---------------------------------
def is_datetime(value):
if value is None:
return True
return value > MIN_DATETIME


Expand Down
6 changes: 2 additions & 4 deletions tests/test_audio.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,7 @@ def test_audio_Album_attrs(album):
assert utils.is_metadata(album.key)
assert utils.is_int(album.librarySectionID)
assert album.listType == "audio"
if album.originallyAvailableAt:
assert utils.is_datetime(album.originallyAvailableAt)
assert utils.is_datetime(album.originallyAvailableAt)
assert utils.is_metadata(album.parentKey)
assert utils.is_int(album.parentRatingKey)
if album.parentThumb:
Expand Down Expand Up @@ -223,8 +222,7 @@ def test_audio_Track_attrs(album):
assert int(track.index) == 1
assert utils.is_metadata(track._initpath)
assert utils.is_metadata(track.key)
if track.lastViewedAt:
assert utils.is_datetime(track.lastViewedAt)
assert utils.is_datetime(track.lastViewedAt)
assert utils.is_int(track.librarySectionID)
assert track.listType == "audio"
# Assign 0 track.media
Expand Down
9 changes: 3 additions & 6 deletions tests/test_video.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,7 @@ def test_video_Movie_attrs(movies):
assert movie.guid == "com.plexapp.agents.imdb://tt1172203?lang=en"
assert utils.is_metadata(movie._initpath)
assert utils.is_metadata(movie.key)
if movie.lastViewedAt:
assert utils.is_datetime(movie.lastViewedAt)
assert utils.is_datetime(movie.lastViewedAt)
assert int(movie.librarySectionID) >= 1
assert movie.listType == "video"
assert movie.originalTitle is None
Expand Down Expand Up @@ -494,8 +493,7 @@ def test_video_Show_attrs(show):
assert utils.is_metadata(show._initpath)
assert utils.is_int(show.index)
assert utils.is_metadata(show.key)
if show.lastViewedAt:
assert utils.is_datetime(show.lastViewedAt)
assert utils.is_datetime(show.lastViewedAt)
assert utils.is_int(show.leafCount)
assert show.listType == "video"
assert len(show.locations[0]) >= 10
Expand Down Expand Up @@ -768,8 +766,7 @@ def test_video_Season_attrs(show):
assert season.index == 1
assert utils.is_metadata(season._initpath)
assert utils.is_metadata(season.key)
if season.lastViewedAt:
assert utils.is_datetime(season.lastViewedAt)
assert utils.is_datetime(season.lastViewedAt)
assert utils.is_int(season.leafCount, gte=3)
assert season.listType == "video"
assert utils.is_metadata(season.parentKey)
Expand Down

0 comments on commit 5db6f49

Please sign in to comment.