* fix #544

* fix ignores
This commit is contained in:
sigma67 2024-04-05 20:53:32 +02:00 • committed by GitHub
commit 2217f3d92d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 64 additions and 8 deletions

File diff suppressed because one or more lines are too long

View file

@ -1,4 +1,7 @@
import json
import warnings
from pathlib import Path
from unittest import mock
import pytest
@ -74,6 +77,15 @@ class TestBrowsing:
escaped_browse_id = yt.get_album_browse_id("OLAK5uy_nbMYyrfeg5ZgknoOsOGBL268hGxtcbnDM")
assert escaped_browse_id == "MPREb_scJdtUCpPE2"
def test_get_album_2024(self, yt):
with open(Path(__file__).parent.parent / "data" / "2024_03_get_album.json", encoding="utf8") as f:
mock_response = json.load(f)
with mock.patch("ytmusicapi.YTMusic._send_request", return_value=mock_response):
album = yt.get_album("MPREabc")
assert len(album["tracks"]) == 19
assert len(album["artists"]) == 1
assert len(album) == 13
def test_get_album(self, yt, yt_auth, sample_album):
album = yt_auth.get_album(sample_album)
assert len(album) >= 9