Пример #1
0
 def test_get_playlists_exists(self):
     """
     If _playlists is not None, playlists() should return it.
     """
     u = UserData(None)
     test_data = ['test', 'hello']
     u._playlists = test_data
     self.assertEqual(u.playlists(), test_data)
Пример #2
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)
Пример #3
0
 def test_get_playlist_with_tracks_exists(self):
     """
     If the playlist with the given ID exists in _playlists and it
     already has a list of tracks, get_playlist_with_tracks() should
     return that playlist data.
     """
     u = UserData(None)
     test_data = [{'id': '0', 'tracks': {'items': []}}]
     u._playlists = test_data
     self.assertEqual(u.get_playlist_with_tracks('0'), test_data[0])