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'])
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
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()
def test_response_tracks_empty(self): response_tracks = [] tracks = [beatport.BeatportTrack(t) for t in response_tracks] self.assertEqual(tracks, [])