Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async def test_wrap_response(aio_jikan):
anime_info = await aio_jikan.anime(MUSHISHI_ID)
mushishi_url = utils.get_main_url(
aio_jikan.base, "anime", MUSHISHI_ID, extension=None, page=None
)
assert isinstance(anime_info, dict)
assert "jikan_url" in anime_info
assert "headers" in anime_info
assert isinstance(anime_info["headers"], dict)
assert mushishi_url == anime_info["jikan_url"]
await aio_jikan.close()
def test_wrap_response(header_keys, jikan):
anime_info = jikan.anime(MUSHISHI_ID)
mushishi_url = utils.get_main_url(
jikan.base, "anime", MUSHISHI_ID, extension=None, page=None
)
assert isinstance(anime_info, dict)
assert "jikan_url" in anime_info
assert "headers" in anime_info
assert isinstance(anime_info["headers"], dict)
assert mushishi_url == anime_info["jikan_url"]
# Test against headers mentioned in documentation
# https://jikan.docs.apiary.io/#introduction/information/caching
assert header_keys.issubset(anime_info["headers"].keys())
def test_get_main_url():
assert (
utils.get_main_url(utils.BASE_URL, "anime", 2, extension=None, page=None)
== "https://api.jikan.moe/v3/anime/2"
)