Example #1
0
 def test_get_playlists_detailed_exists(self):
     """
     If _playlists has detailed playlist data, playlists_detailed()
     should return it.
     """
     u = UserData(None)
     test_data = [{'followers': 0}, {'followers': 5}]
     u._playlists = test_data
     self.assertEqual(u.playlists_detailed(), test_data)
Example #2
0
 def test_compile_playlist_details(self):
     """
     compile_playlist_details() should request detailed data about
     the user's playlists from Spotify and store it in the 
     _playlists variable.
     """
     u = UserData(self.session)
     data = u.playlists_detailed()
     self.assertGreaterEqual(len(data), 5)
     for p in data:
         self.assertEqual(p['type'], 'playlist')
         self.assertIsNotNone(p.get('followers'))