feat: add types to args

This commit is contained in:
bvandercar-vt committed 2025-12-02 15:10:06 -07:00
1 parent 9119b6a070
commit efc3474e27
7 files changed
+419 -284

No files matched your search

+5 -2
View File
@@ -1,9 +1,12 @@
import base64
from typing import Union
import requests
from spotipy import Spotify
def get_spotify_playlist(spotify_object, playlist_name, username):
def get_spotify_playlist(spotify_object: Spotify, playlist_name: str, username: str):
playlists = spotify_object.user_playlists(username)
while playlists:
for item in playlists['items']:
@@ -12,5 +15,5 @@ def get_spotify_playlist(spotify_object, playlist_name, username):
playlists = spotify_object.next(playlists)
def get_as_base64(url):
def get_as_base64(url: Union[str, bytes]) -> str:
return base64.b64encode(requests.get(url).content).decode("utf-8")
+1 -1
View File
@@ -13,7 +13,7 @@ patch = mock.patch
DEFAULT = mock.DEFAULT
def _make_fake_token(expires_at, expires_in, scope):
def _make_fake_token(expires_at: int, expires_in: int, scope: str):
return dict(
expires_at=expires_at,
expires_in=expires_in,