update a couple tests
- replace deleted albums - `MPREb_TPH4WqN5pUo`'s unavailable tracks are now in the tracklist - handle podcast episodes in video results
This commit is contained in:
parent
445833f420
commit
3f27d9bd07
2 changed files with 7 additions and 9 deletions
|
|
@ -121,19 +121,15 @@ class TestBrowsing:
|
||||||
assert album["audioPlaylistId"] is not None
|
assert album["audioPlaylistId"] is not None
|
||||||
assert len(album["tracks"]) == 7
|
assert len(album["tracks"]) == 7
|
||||||
assert len(album["tracks"][0]["artists"]) == 1
|
assert len(album["tracks"][0]["artists"]) == 1
|
||||||
album = yt.get_album("MPREb_rqH94Zr3NN0")
|
album = yt.get_album("MPREb_7HdnOQMfJ3w")
|
||||||
assert album["likeStatus"] is not None
|
assert album["likeStatus"] is not None
|
||||||
assert album["audioPlaylistId"] is not None
|
assert album["audioPlaylistId"] is not None
|
||||||
assert len(album["tracks"][0]["artists"]) == 2
|
assert len(album["tracks"][0]["artists"]) == 2
|
||||||
album = yt.get_album("MPREb_TPH4WqN5pUo") # album with tracks completely removed/missing
|
album = yt.get_album("MPREb_G21w42zx0qJ") # album with track (#13) disabled/greyed out
|
||||||
assert album["likeStatus"] is not None
|
assert album["likeStatus"] is not None
|
||||||
assert album["audioPlaylistId"] is not None
|
assert album["audioPlaylistId"] is not None
|
||||||
assert album["tracks"][0]["trackNumber"] == 3
|
assert album["tracks"][12]["trackNumber"] is None
|
||||||
assert album["tracks"][13]["trackNumber"] == 18
|
assert not album["tracks"][12]["isAvailable"]
|
||||||
album = yt.get_album("MPREb_YuigcYm2erf") # album with track (#8) disabled/greyed out
|
|
||||||
assert album["likeStatus"] is not None
|
|
||||||
assert album["audioPlaylistId"] is not None
|
|
||||||
assert album["tracks"][7]["trackNumber"] is None
|
|
||||||
|
|
||||||
def test_get_album_errors(self, yt):
|
def test_get_album_errors(self, yt):
|
||||||
with pytest.raises(Exception, match="Invalid album browseId"):
|
with pytest.raises(Exception, match="Invalid album browseId"):
|
||||||
|
|
|
||||||
|
|
@ -81,7 +81,9 @@ class TestSearch:
|
||||||
assert all(item["resultType"] == "song" for item in results)
|
assert all(item["resultType"] == "song" for item in results)
|
||||||
results = yt_auth.search(query, filter="videos")
|
results = yt_auth.search(query, filter="videos")
|
||||||
assert len(results) > 10
|
assert len(results) > 10
|
||||||
assert all(item["views"] != "" for item in results)
|
assert all(
|
||||||
|
item["views"] != "" for item in results if item["videoType"] != "MUSIC_VIDEO_TYPE_PODCAST_EPISODE"
|
||||||
|
) # video results include podcast episodes, which can't track views
|
||||||
assert all(item["resultType"] == "video" for item in results)
|
assert all(item["resultType"] == "video" for item in results)
|
||||||
results = yt_auth.search(query, filter="albums", limit=40)
|
results = yt_auth.search(query, filter="albums", limit=40)
|
||||||
assert len(results) > 20
|
assert len(results) > 20
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue