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_user_url_with_friends_and_page():
assert (
utils.get_user_url(
utils.BASE_URL,
"Xinil",
request="friends",
argument=None,
page=2,
parameters=None,
)
== "https://api.jikan.moe/v3/user/xinil/friends/2"
)
def test_get_user_url_with_anime_history():
assert (
utils.get_user_url(
utils.BASE_URL,
"Xinil",
request="history",
argument="anime",
page=None,
parameters=None,
)
== "https://api.jikan.moe/v3/user/xinil/history/anime"
)
def test_get_user_url():
assert (
utils.get_user_url(
utils.BASE_URL,
"Xinil",
request=None,
argument=None,
page=None,
parameters=None,
)
== "https://api.jikan.moe/v3/user/xinil"
)
def test_get_user_url_with_animelist_and_page_parameter():
assert (
utils.get_user_url(
utils.BASE_URL,
"Xinil",
request="animelist",
argument="completed",
page=None,
parameters={"page": 2},
)
== "https://api.jikan.moe/v3/user/xinil/animelist/completed?page=2"
)
def test_get_user_url_with_profile():
assert (
utils.get_user_url(
utils.BASE_URL,
"Xinil",
request="profile",
argument=None,
page=None,
parameters=None,
)
== "https://api.jikan.moe/v3/user/xinil/profile"
)
>>> await jikan.user(username='Xinil')
>>> await jikan.user(username='Xinil', request='profile')
>>> await jikan.user(username='Xinil', request='friends', page=2)
>>> await jikan.user(username='Xinil', request='history')
>>> await jikan.user(username='Xinil', request='animelist', argument='ptw')
>>> await jikan.user(
username='Xinil', request='animelist', parameters={'page': 2}
)
>>> await jikan.user(
username='Xinil',
request='animelist',
argument='ptw',
parameters={'page': 2}
)
"""
url = utils.get_user_url(
self.base, username, request, argument, page, parameters
)
return await self._request(url, username=username, request=request)
>>> jikan.user(username='Xinil')
>>> jikan.user(username='Xinil', request='profile')
>>> jikan.user(username='Xinil', request='friends', page=2)
>>> jikan.user(username='Xinil', request='history')
>>> jikan.user(username='Xinil', request='animelist', argument='ptw')
>>> jikan.user(
username='Xinil', request='animelist', parameters={'page': 2}
)
>>> jikan.user(
username='Xinil',
request='animelist',
argument='ptw',
parameters={'page': 2}
)
"""
url = utils.get_user_url(
self.base, username, request, argument, page, parameters
)
return self._request(url, username=username, request=request)