improve coverage

This commit is contained in:
sigma67 2024-02-04 16:59:24 +01:00 • committed by sigma67
commit f98274f0ec
5 changed files with 15 additions and 26 deletions

View file

@ -1,3 +1,6 @@
import pytest
class TestWatch:
def test_get_watch_playlist(self, config, yt, yt_brand, yt_oauth):
playlist = yt_oauth.get_watch_playlist(
@ -14,3 +17,7 @@ class TestWatch:
assert len(playlist["tracks"]) == config.getint("albums", "album_track_length")
playlist = yt_brand.get_watch_playlist(playlistId=config["playlists"]["own"], shuffle=True)
assert len(playlist["tracks"]) == config.getint("playlists", "own_length")
def test_get_watch_playlist_errors(self, config, yt):
with pytest.raises(Exception, match="No content returned by the server"):
yt.get_watch_playlist(playlistId="PL_NOT_EXIST")