def test_if_next_song_works_correctly_for_repeat_True(self): playlist = PlayList(repeat=True) playlist.add_song(self.test_song1) playlist.next_song() res = playlist.next_song() exp = self.test_song1 self.assertEqual(res, exp)
def test_if_next_song_raises_Exception_for_empty_playlist(self): playlist = PlayList() res = None exp = "PlayList is empty" try: playlist.next_song() except Exception as e: res = str(e) self.assertEqual(res, exp)
def test_if_next_song_raises_Exception_when_reaches_the_end_of_the_list_and_range_False(self): playlist = PlayList() playlist.add_song(self.test_song1) res = None exp = "You have reached the end of the playlist" playlist.next_song() try: playlist.next_song() except Exception as e: res = str(e) self.assertEqual(res, exp)