Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_get_main_url_with_extension_and_page():
assert (
utils.get_main_url(utils.BASE_URL, "anime", 2, extension="episodes", page=2)
== "https://api.jikan.moe/v3/anime/2/episodes/2"
)
def _get(
self,
endpoint: str,
id: int,
extension: Optional[str],
page: Optional[int] = None,
) -> Dict[str, Any]:
"""Gets the response from Jikan API given the endpoint:
anime, manga, character, person, club
"""
url = utils.get_main_url(self.base, endpoint, id, extension, page)
return self._request(url, id=id, endpoint=endpoint)
async def _get(
self,
endpoint: str,
id: int,
extension: Optional[str],
page: Optional[int] = None,
) -> Dict[str, Any]:
"""Gets the response from Jikan API given the endpoint:
anime, manga, character, person, club
"""
url = utils.get_main_url(self.base, endpoint, id, extension, page)
return await self._request(url, id=id, endpoint=endpoint)