def test_if_artists_works_correctly(self):
     playlist = PlayList()
     playlist.add_song(self.test_song1)
     playlist.add_song(self.test_song2)
     exp = {'Goran Bregovic': 1, 'Mahmood': 1}
     res = playlist.artists()
     self.assertEqual(res, exp)
    def test_if_save_and_load_works_correctly(self):
        playlist = PlayList(name="For Code")
        playlist.add_song(self.test_song1)
        playlist.add_song(self.test_song2)
        playlist.save()
        playlist2 = PlayList.load('For-Code.json')

        res = playlist.songs == playlist2.songs \
              and playlist.name == playlist2.name \
              and playlist.artists() == playlist2.artists()

        self.assertTrue(res)
        os.remove('playlist-data/For-Code.json')