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_creator_url_with_page():
assert (
utils.get_creator_url(utils.BASE_URL, "producer", 2, page=2)
== "https://api.jikan.moe/v3/producer/2/2"
)
def test_get_creator_url():
assert (
utils.get_creator_url(utils.BASE_URL, "producer", 2, page=None)
== "https://api.jikan.moe/v3/producer/2"
)
def _get_creator(
self, creator_type: str, creator_id: int, page: Optional[int] = None
) -> Dict[str, Any]:
"""Gets the response from Jikan API for producer and magazine"""
url = utils.get_creator_url(self.base, creator_type, creator_id, page)
return self._request(url, id=creator_id, endpoint=creator_type)
async def _get_creator(
self, creator_type: str, creator_id: int, page: Optional[int] = None
) -> Dict[str, Any]:
"""Gets the response from Jikan API for producer and magazine"""
url = utils.get_creator_url(self.base, creator_type, creator_id, page)
return await self._request(url, id=creator_id, endpoint=creator_type)