Esempio n. 1
0
 def testSaveLyrics(self):
     """testSaveLyrics - Ensures lyrics for a track are saved in the
     database"""
     # Only need a filename that matches something in the database, the rest
     # of the track is for construction purposes only
     track = Track('/filename/000', '', 0, '', '', 0, 1, '', None)
     self.musiclibrary.save_lyrics(track, 'some lyrics here')
     self.assertEqual(track.lyrics, 'some lyrics here')
Esempio n. 2
0
 def test_bad_album(self):
     '''Test that a bad album in the track returns AlbumHasNoTracks.'''
     bad_track = Track('', '', 1, '', 'foo-bar-baz**', 2, 3, '',
         self.music_library._create_album)
     try:
         # pylint: disable-msg=W0612
         album = bad_track.album
         self.fail()
     except AlbumHasNoTracks:
         pass
Esempio n. 3
0
 def setUp(self):
     TestMusic.setUp(self)
     self.music_library = MusicLibrary()
     self.track = Track('/path/to/track.mp3', # filename
                        'title',
                        1, # tracknumber
                        'artist0',
                        'album0',
                        2008, # year
                        240, # length
                        'lyrics',
                         self.music_library._create_album)