>=3.10 strict typing (#765)
* >=3.10 * fully typed (mypy strict mode enabled) * fix tests (get_tasteprofile now requires auth - serverside) * update linters * fix uploads search
This commit is contained in:
parent
03acc6ecff
commit
a979691bb0
47 changed files with 717 additions and 503 deletions
|
|
@ -1,3 +1,5 @@
|
|||
from typing import Any
|
||||
|
||||
import pytest
|
||||
|
||||
from ytmusicapi import YTMusic
|
||||
|
|
@ -51,7 +53,7 @@ class TestSearch:
|
|||
),
|
||||
],
|
||||
)
|
||||
def test_search_album_artists(self, yt, case: tuple[str, dict]):
|
||||
def test_search_album_artists(self, yt, case: tuple[str, dict[str, Any]]):
|
||||
(query, expected) = case
|
||||
results = yt.search(query, filter="albums")
|
||||
|
||||
|
|
@ -125,6 +127,9 @@ class TestSearch:
|
|||
)
|
||||
results = yt_oauth.search(config["queries"]["uploads_songs"], scope="uploads", limit=40)
|
||||
assert len(results) > 20
|
||||
assert all(isinstance(item["title"], str) for item in results)
|
||||
assert all(item.get("browseId", None) or item.get("videoId", None) for item in results)
|
||||
assert all(len(item["thumbnails"]) >= 2 for item in results)
|
||||
|
||||
def test_search_library(self, config, yt_oauth):
|
||||
results = yt_oauth.search(config["queries"]["library_any"], scope="library")
|
||||
|
|
|
|||
Loading…
Reference in a new issue