Esempio n. 1
0
    def test_get_songs(self):

        milky_chance = AmDmTestCase.EN_ARTISTS[2]
        artist = Artist(milky_chance["url"])

        songs = artist.get_songs()

        for song, mc_song in zip(songs, AmDmTestCase.MILKY_CHANCE_SONGS):
            self.assertIsInstance(song, Song)
            self.assertEqual(song.name, mc_song[0])
            self.assertEqual(song.url, mc_song[1])
Esempio n. 2
0
    def test_get_song(self):

        for en_artist, en_song in zip(AmDmTestCase.EN_ARTISTS,
                                      AmDmTestCase.EN_SONGS):

            artist = Artist(en_artist["url"])
            songs = artist.get_songs()

            chosen_song = songs[en_song["number"] - 1]

            self.assertEqual(chosen_song.name, en_song["name"])
            self.assertEqual(chosen_song.url, en_song["url"])

        for ru_artist, ru_song in zip(AmDmTestCase.RU_ARTISTS,
                                      AmDmTestCase.RU_SONGS):

            artist = Artist(ru_artist["url"])
            songs = artist.get_songs()

            chosen_song = songs[ru_song["number"] - 1]

            self.assertEqual(chosen_song.name, ru_song["name"])
            self.assertEqual(chosen_song.url, ru_song["url"])