From 69522331df77da92e82b1aaae250a0b4349c49f3 Mon Sep 17 00:00:00 2001 From: Ritiek Malhotra Date: Sat, 20 Jul 2019 21:49:25 +0530 Subject: [PATCH] Fix tests --- spotdl/internals.py | 2 +- test/test_patcher.py | 4 ++-- test/test_spotify_tools.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/spotdl/internals.py b/spotdl/internals.py index 854a3dc..64a3acc 100644 --- a/spotdl/internals.py +++ b/spotdl/internals.py @@ -258,7 +258,7 @@ def remove_duplicates(tracks): def content_available(url): try: response = urllib.request.urlopen(url) - except HTTPError: + except urllib.request.HTTPError: return False else: return response.getcode() < 300 diff --git a/test/test_patcher.py b/test/test_patcher.py index f0f92aa..3c9ba65 100644 --- a/test/test_patcher.py +++ b/test/test_patcher.py @@ -23,12 +23,12 @@ class TestMethodCalls: def test_pafy_getbestthumb(self, content_fixture): thumbnail = patcher._getbestthumb(content_fixture) - assert thumbnail == "https://i.ytimg.com/vi/3nQNiWdeH2Q/maxresdefault.jpg" + assert thumbnail == "https://i.ytimg.com/vi/3nQNiWdeH2Q/hqdefault.jpg" def test_pafy_getbestthumb_without_ytdl(self, content_fixture): content_fixture._ydl_info["thumbnails"][0]["url"] = None thumbnail = patcher._getbestthumb(content_fixture) - assert thumbnail == "https://i.ytimg.com/vi/3nQNiWdeH2Q/maxresdefault.jpg" + assert thumbnail == "https://i.ytimg.com/vi/3nQNiWdeH2Q/sddefault.jpg" def test_pafy_content_available(self): diff --git a/test/test_spotify_tools.py b/test/test_spotify_tools.py index e0bc28d..b7d3dfe 100644 --- a/test/test_spotify_tools.py +++ b/test/test_spotify_tools.py @@ -141,7 +141,7 @@ class TestFetchAlbumsFromArtist: return albums def test_len(self, albums_from_artist_fixture): - assert len(albums_from_artist_fixture) == 53 + assert len(albums_from_artist_fixture) == 54 def test_zeroth_album_name(self, albums_from_artist_fixture): assert albums_from_artist_fixture[0]["name"] == "Revolution Radio"