Skip to content

Commit

Permalink
Fixed misc tests: Fix default_cover test, fix lyrics test. Renamed pk…
Browse files Browse the repository at this point in the history
…ce example
  • Loading branch information
tehkillerbee committed Feb 29, 2024
1 parent c3ede70 commit b4157c2
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
2 changes: 1 addition & 1 deletion examples/pkce_login.py → examples/pkce_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# You should have received a copy of the GNU Lesser General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
"""pkce_login.py: A simple example script that describes how to use PKCE login and MPEG-DASH streams"""
"""pkce_example.py: A simple example script that describes how to use PKCE login and MPEG-DASH streams"""

import tidalapi
from tidalapi import Quality
Expand Down
15 changes: 10 additions & 5 deletions tests/test_album.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,16 @@ def test_no_release_date(session):
)


def test_default_image_used_if_no_cover_art(mocker):
# TODO find an example if there still are any.
album = Album(mocker.Mock(), None)
assert album.cover is None
assert album.image(1280) == tidalapi.album.DEFAULT_ALBUM_IMAGE
def test_default_image_not_used_on_albums_with_cover_art(session):
album = session.album(108043414)
assert album.cover is not None
default_album_url = "https://resources.tidal.com/images/%s/%ix%i.jpg" % (
tidalapi.album.DEFAULT_ALBUM_IMG.replace("-", "/"),
1280,
1280,
)
# Album should not use default album art
assert album.image(1280) != default_album_url


def test_similar(session):
Expand Down
4 changes: 2 additions & 2 deletions tests/test_media.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ def test_track_url(session):
def test_lyrics(session):
track = session.track(56480040)
lyrics = track.lyrics()
assert "Think we're there" in lyrics.text
assert "Think we're there" in lyrics.subtitles
assert "I think we're there" in lyrics.text
assert "I think we're there" in lyrics.subtitles
assert lyrics.right_to_left is False


Expand Down

0 comments on commit b4157c2

Please sign in to comment.