def test_get_saved_tracks_exists(self): """ If _saved_tracks is not None, saved_tracks() should return it. """ u = UserData(None) test_data = ['hello', 'goodbye'] u._saved_tracks = test_data self.assertEqual(u.saved_tracks(), test_data)
def test_compile_saved_tracks(self): """ _compile_saved_tracks() should request data about the user's saved tracks from Spotify and store it in the _saved_tracks variable. """ u = UserData(self.session) data = u.saved_tracks() self.assertGreaterEqual(len(data), 5) for t in data: self.assertEqual(t['type'], 'track')