Beispiel #1
0
 def test_throw_error_if_track_exists(self):
     """
     Should throw DuplicateTrackError given track for disc already exists
     """
     album = GMusicAlbum(id, title, album_artist)
     album.add_track(1, 3, track)
     self.assertRaises(DuplicateTrackError, album.add_track, 1, 3, track)
Beispiel #2
0
 def test_add_track_to_album_on_another_disc(self):
     """
     Should add track to album given same trackNum on different disc
     """
     album = GMusicAlbum(id, title, album_artist)
     album.add_track(1, 3, track)
     album.add_track(2, 3, track2)
     self.assertEqual(len(album.tracks[2]), 1)
     self.assertEqual(album.tracks.get(2).get(3).title, 'Zhao Hua')
Beispiel #3
0
 def test_add_track_to_album(self):
     """
     Should add track to album
     """
     album = GMusicAlbum(id, title, album_artist)
     album.add_track(1, 3, track)
     self.assertEqual(len(album.tracks), 1)
     self.assertEqual(len(album.tracks[1]), 1)
     self.assertEqual(album.tracks.get(1).get(3).title, 'Limerence')
Beispiel #4
0
 def test_album_total_tracks_count_one_disc(self):
     """
     Given tracks have been added to tracks across 1 disc
     Should return the correct number of tracks added
     """
     album = GMusicAlbum(id, title, album_artist)
     album.add_track(1, 3, track)
     album.add_track(1, 2, track)
     expected = 2
     actual = album.total_tracks()
     self.assertEqual(actual, expected)
Beispiel #5
0
 def test_discs_added(self):
     """
     Given tracks have been added to tracks across 2 discs
     Should return the correct number of discs
     """
     album = GMusicAlbum(id, title, album_artist)
     album.add_track(1, 3, track)
     album.add_track(1, 2, track)
     album.add_track(2, 1, track)
     expected = set([1, 2])
     actual = album.discs_added()
     self.assertEqual(actual, expected)