spotipy/tests/client_credentials_tests.py
2020-01-11 19:54:20 +00:00

37 lines
756 B
Python

# -*- coding: utf-8 -*-
""" Client Credentials Requests Tests """
import os
import sys
import unittest
sys.path.insert(0, os.path.abspath(os.pardir))
from spotipy import (
Spotify,
SpotifyClientCredentials,
)
class ClientCredentialsTestSpotipy(unittest.TestCase):
'''
These tests require user authentication
'''
@classmethod
def setUpClass(self):
self.spotify = Spotify(client_credentials_manager=SpotifyClientCredentials())
self.spotify.trace = False
muse_urn = 'spotify:artist:12Chz98pHFMPJEknJQMWvI'
def test_request_with_token(self):
artist = self.spotify.artist(self.muse_urn)
self.assertTrue(artist['name'] == 'Muse')
if __name__ == '__main__':
unittest.main()