示例#1
0
    def test_genre_empty(self):
        """No 'genre' is provided. Test if 'sub_genre' is applied.
        """
        self.response_tracks[0]['genres'] = []
        tracks = [beatport.BeatportTrack(t) for t in self.response_tracks]

        self.test_tracks[0]['genres'] = []

        self.assertEqual(tracks[0].genre,
                         self.test_tracks[0]['subGenres'][0]['name'])
示例#2
0
    def setUp(self):
        self.setup_beets()
        self.load_plugins('beatport')
        self.lib = library.Library(':memory:')

        # Set up 'tracks'.
        self.response_tracks = self._make_tracks_response()
        self.tracks = [beatport.BeatportTrack(t) for t in self.response_tracks]

        # Make alias to be congruent with class `BeatportTest`.
        self.test_tracks = self.response_tracks
示例#3
0
    def setUp(self):
        self.setup_beets()
        self.load_plugins('beatport')
        self.lib = library.Library(':memory:')

        # Set up 'album'.
        response_release = self._make_release_response()
        self.album = beatport.BeatportRelease(response_release)

        # Set up 'tracks'.
        response_tracks = self._make_tracks_response()
        self.tracks = [beatport.BeatportTrack(t) for t in response_tracks]

        # Set up 'test_album'.
        self.test_album = self.mk_test_album()

        # Set up 'test_tracks'
        self.test_tracks = self.test_album.items()
示例#4
0
 def test_response_tracks_empty(self):
     response_tracks = []
     tracks = [beatport.BeatportTrack(t) for t in response_tracks]
     self.assertEqual(tracks, [])