add respx for weibo target

This commit is contained in:
felinae98 2022-05-20 13:08:51 +08:00
parent 12b8111934
commit 12136023cb
No known key found for this signature in database
GPG Key ID: 00C8B010587FF610

View File

@ -23,7 +23,14 @@ def weibo_ak_list_1():
@pytest.mark.asyncio
@respx.mock
async def test_get_name(weibo):
profile_router = respx.get(
"https://m.weibo.cn/api/container/getIndex?containerid=1005056279793937"
)
profile_router.mock(
return_value=Response(200, json=get_json("weibo_ak_profile.json"))
)
name = await weibo.get_target_name("6279793937")
assert name == "明日方舟Arknights"