How to use the jikanpy.utils function in jikanpy

To help you get started, we’ve selected a few jikanpy examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github AWConant / jikanpy / tests / test_aiojikan.py View on Github external
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()
github AWConant / jikanpy / tests / test_jikan.py View on Github external
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())
github AWConant / jikanpy / tests / test_utils.py View on Github external
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"
    )