コード例 #1
0
 def test_tracks(self):
     for track in self.tracks:
         track = cursor.search(Search.TYPE_TRACKS, track, single=True)
         self.assertEqual(
             len(track.title) > 0, True, 'Track search not work!')
         self.assertEqual(len(track.open().read(200)), 200,
                          'Track downloading not work!')
コード例 #2
0
 def test_artist(self):
     for artist in self.artists:
         artist_list = list(
             islice(cursor.search(Search.TYPE_ARTISTS, artist), 1)
         )
         if artist == self.not_fount_artist:
             self.assertEqual(
                 len(artist_list), 0,
                 'Not found not work!'
             )
         else:
             self.assertEqual(
                 len(artist_list), 1,
                 'Search artist not work!'
             )
             artist_obj = artist_list[0]
             albums = list(artist_obj.get_albums())
             self.assertEqual(
                 len(albums) > 0, True,
                 'get_album not work!'
             )
             for album in albums:
                 tracks = list(album.get_tracks())
                 self.assertEqual(
                     len(tracks) > 0, True,
                     'get_tracks from album not work!'
                 )
コード例 #3
0
 def test_tracks(self):
     for track in self.tracks:
         track = cursor.search(Search.TYPE_TRACKS, track, single=True)
         self.assertEqual(
             len(track.title) > 0, True,
             'Track search not work!'
         )
         self.assertEqual(
             len(track.open().read(200)), 200,
             'Track downloading not work!'
         )
コード例 #4
0
 def test_albums(self):
     for album in self.albums:
         album_list = list(
             islice(cursor.search(Search.TYPE_ALBUMS, album), 1))
         if album == self.not_found_album:
             self.assertEqual(len(album_list), 0, 'Not found not work!')
         else:
             self.assertEqual(len(album_list), 1, 'Search album not work!')
             album_obj = album_list[0]
             tracks = list(album_obj.get_tracks())
             self.assertEqual(
                 len(tracks) > 0, True, 'get_tracks from album not work!')
コード例 #5
0
 def test_albums(self):
     for album in self.albums:
         album_list = list(
             islice(cursor.search(Search.TYPE_ALBUMS, album), 1)
         )
         if album == self.not_found_album:
             self.assertEqual(
                 len(album_list), 0,
                 'Not found not work!'
             )
         else:
             self.assertEqual(
                 len(album_list), 1,
                 'Search album not work!'
             )
             album_obj = album_list[0]
             tracks = list(album_obj.get_tracks())
             self.assertEqual(
                 len(tracks) > 0, True,
                 'get_tracks from album not work!'
             )