Extract song count from text (#609)
* Extract song count from text * Add fix in parsers * add test --------- Co-authored-by: sigma67 <sigma67.github@gmail.com>
This commit is contained in:
parent
8cc72e3863
commit
08d9f3049c
3 changed files with 17 additions and 4 deletions
|
|
@ -5,6 +5,9 @@ from unittest import mock
|
|||
|
||||
import pytest
|
||||
|
||||
from ytmusicapi import YTMusic
|
||||
from ytmusicapi.constants import SUPPORTED_LANGUAGES
|
||||
|
||||
|
||||
class TestPlaylists:
|
||||
@pytest.mark.parametrize(
|
||||
|
|
@ -57,6 +60,12 @@ class TestPlaylists:
|
|||
assert len(playlist["tracks"]) > 200
|
||||
assert len(playlist["related"]) == 0
|
||||
|
||||
@pytest.mark.parametrize("language", SUPPORTED_LANGUAGES)
|
||||
def test_get_playlist_languages(self, language):
|
||||
yt = YTMusic(language=language)
|
||||
result = yt.get_playlist("PLj4BSJLnVpNyIjbCWXWNAmybc97FXLlTk")
|
||||
assert result["trackCount"] == 255
|
||||
|
||||
def test_get_playlist_owned(self, config, yt_brand):
|
||||
playlist = yt_brand.get_playlist(config["playlists"]["own"], related=True, suggestions_limit=21)
|
||||
assert len(playlist["tracks"]) < 100
|
||||
|
|
|
|||
Loading…
Reference in a new issue