def test_successful_translation(self, web_artist_mock): ref = translator.web_to_artist_ref(web_artist_mock) assert ref.type == "artist" assert ref.uri == "spotify:artist:abba" assert ref.name == "ABBA"
def test_without_name_uses_uri(self, web_artist_mock): del web_artist_mock["name"] ref = translator.web_to_artist_ref(web_artist_mock) assert ref.name == "spotify:artist:abba"
def test_returns_none_if_bad_data(self, web_data): assert translator.web_to_artist_ref(web_data) is None