def test_get_followed_artists_exists(self): """ If _followed_artists is not None, followed_artists() should return it. """ u = UserData(None) test_data = ['hello', 'goodbye'] u._followed_artists = test_data self.assertEqual(u.followed_artists(), test_data)
def test_compile_followed_artists(self): """ _compile_followed_artists() should request data about the user's followed artists from Spotify and store it in the _followed_artists variable. """ u = UserData(self.session) data = u.followed_artists() self.assertGreaterEqual(len(data), 2) for a in data: self.assertEqual(a['type'], 'artist')