Ejemplo n.º 1
0
 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)
Ejemplo n.º 2
0
 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')