示例#1
0
    def test_if_remove_song_works_correctly_for_valid_song(self):
        playlist = PlayList()
        playlist.add_song(self.test_song1)
        playlist.remove_song(self.test_song1)

        exp = 0
        res = len(playlist.songs)
        self.assertEqual(res, exp)
示例#2
0
 def test_if_remove_song_raises_Exception_when_the_argument_is_not_of_type_Song(self):
     playList = PlayList()
     exp = "Wrong argument type"
     res = None
     try:
         playList.remove_song("a")
     except Exception as e:
         res = str(e)
     self.assertEqual(res, exp)
示例#3
0
 def test_if_remove_song_raises_Exception_when_song_doesnt_exist(self):
     playList = PlayList()
     exp = "Song is not in the playlist"
     res = None
     try:
         playList.remove_song(self.test_song1)
     except Exception as e:
         res = str(e)
     self.assertEqual(res, exp)