-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #45 from dotX12/dev-issues-35-about_artists
Fix and added new tests
- Loading branch information
Showing
5 changed files
with
44 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import pytest | ||
|
||
from shazamio import Serialize | ||
from shazamio import Shazam | ||
from shazamio.schemas.artists import ArtistQuery | ||
from shazamio.schemas.enums import ArtistExtend | ||
from shazamio.schemas.enums import ArtistView | ||
|
||
|
||
@pytest.mark.asyncio | ||
async def test_about_artist(): | ||
shazam = Shazam(language="ES") | ||
artist_id = 659860538 | ||
|
||
about_artist = await shazam.artist_about( | ||
artist_id, | ||
query=ArtistQuery( | ||
views=[ | ||
ArtistView.FULL_ALBUMS, | ||
ArtistView.LATEST_RELEASE, | ||
], | ||
extend=[ | ||
ArtistExtend.ARTIST_BIO, | ||
ArtistExtend.BORN_OF_FORMED, | ||
ArtistExtend.EDITORIAL_ARTWORK, | ||
ArtistExtend.ORIGIN, | ||
], | ||
), | ||
) | ||
|
||
serialized = Serialize.artist_v2(about_artist) | ||
assert serialized.data[0].attributes.name == "Markul" | ||
assert "Hip-hop/Rap" in serialized.data[0].attributes.genre_names |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters