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_meta_url_with_weekly_anime_requests_and_offset():
assert (
utils.get_meta_url(
utils.BASE_URL, "requests", type="anime", period="weekly", offset=2,
)
== "https://api.jikan.moe/v3/meta/requests/anime/weekly/2"
)
def test_get_meta_url_with_type_and_no_period():
assert (
utils.get_meta_url(
utils.BASE_URL, "requests", type="anime", period=None, offset=None,
)
== "https://api.jikan.moe/v3/meta/requests"
)
def test_get_meta_url():
assert (
utils.get_meta_url(
utils.BASE_URL, "status", type=None, period=None, offset=None
)
== "https://api.jikan.moe/v3/meta/status"
)
def test_get_meta_url_with_no_type_and_period():
assert (
utils.get_meta_url(
utils.BASE_URL, "requests", type=None, period="weekly", offset=None,
)
== "https://api.jikan.moe/v3/meta/requests"
)
Defaults to None.
period (:obj:`str`, optional): Time period to get for requests.
Possible values are today, weekly, and monthly. Defaults to
None.
offset (:obj:`int`, optional): 1,000 requests are shown per page.
Offset is used to show more. Defaults to None.
Returns:
Dict: Dictionary containing meta information.
Examples:
>>> await jikan.meta('requests')
>>> await jikan.meta('requests', type='anime', period='today')
>>> await jikan.meta('status')
"""
url = utils.get_meta_url(self.base, request, type, period, offset)
return await self._request(url, request=request, type=type, period=period)
Defaults to None.
period (:obj:`str`, optional): Time period to get for requests.
Possible values are today, weekly, and monthly. Defaults to
None.
offset (:obj:`int`, optional): 1,000 requests are shown per page.
Offset is used to show more. Defaults to None.
Returns:
Dict: Dictionary containing meta information.
Examples:
>>> jikan.meta('requests')
>>> jikan.meta('requests', type='anime', period='today')
>>> jikan.meta('status')
"""
url = utils.get_meta_url(self.base, request, type, period, offset)
return self._request(url, request=request, type=type, period=period)