예제 #1
0
 def test_get_saved_albums_exists(self): 
     """
     If _saved_albums is not None, saved_albums() should return it.
     """
     u = UserData(None)
     test_data = ['hello', 'goodbye']
     u._saved_albums = test_data
     self.assertEqual(u.saved_albums(), test_data)
예제 #2
0
 def test_compile_saved_albums(self):
     """
     _compile_saved_albums() should request data about the user's
     saved albums from Spotify and store it in the _saved_albums
     variable.
     """
     u = UserData(self.session)
     data = u.saved_albums()
     self.assertGreaterEqual(len(data), 5)
     for a in data:
         self.assertEqual(a['type'], 'album')