mirror of
https://github.com/suyiiyii/nonebot-bison.git
synced 2026-05-09 18:27:56 +08:00
add terra-historicus
This commit is contained in:
@@ -0,0 +1 @@
|
||||
{"code":0,"msg":"","data":[{"coverUrl":"https://web.hycdn.cn/comic/pic/20220507/c4da4fb95587101f1867a30fe85cb557.png","comicCid":"6253","title":"123罗德岛!?","subtitle":"你可能不知道的罗德岛小剧场!","episodeCid":"5771","episodeType":1,"episodeShortTitle":"「流明」篇","updateTime":1652025600},{"coverUrl":"https://web.hycdn.cn/comic/pic/20220505/5c296539f5dc808603f20dda86879c9c.png","comicCid":"0696","title":"A1行动预备组","subtitle":"","episodeCid":"2897","episodeType":1,"episodeShortTitle":"01","updateTime":1651852800},{"coverUrl":"https://web.hycdn.cn/comic/pic/20220428/f4dc1e91420d18eccb80d60bba322d42.png","comicCid":"6253","title":"123罗德岛!?","subtitle":"你可能不知道的罗德岛小剧场!","episodeCid":"6346","episodeType":1,"episodeShortTitle":"「艾丽妮」篇","updateTime":1651507200}]}
|
||||
@@ -0,0 +1 @@
|
||||
{"code":0,"msg":"","data":[{"coverUrl":"https://web.hycdn.cn/comic/pic/20220507/ab8a2ff408ec7d587775aed70b178ec0.png","comicCid":"6253","title":"123罗德岛!?","subtitle":"你可能不知道的罗德岛小剧场!","episodeCid":"4938","episodeType":1,"episodeShortTitle":"「掠风」篇","updateTime":1652112000},{"coverUrl":"https://web.hycdn.cn/comic/pic/20220507/c4da4fb95587101f1867a30fe85cb557.png","comicCid":"6253","title":"123罗德岛!?","subtitle":"你可能不知道的罗德岛小剧场!","episodeCid":"5771","episodeType":1,"episodeShortTitle":"「流明」篇","updateTime":1652025600},{"coverUrl":"https://web.hycdn.cn/comic/pic/20220505/5c296539f5dc808603f20dda86879c9c.png","comicCid":"0696","title":"A1行动预备组","subtitle":"","episodeCid":"2897","episodeType":1,"episodeShortTitle":"01","updateTime":1651852800},{"coverUrl":"https://web.hycdn.cn/comic/pic/20220428/f4dc1e91420d18eccb80d60bba322d42.png","comicCid":"6253","title":"123罗德岛!?","subtitle":"你可能不知道的罗德岛小剧场!","episodeCid":"6346","episodeType":1,"episodeShortTitle":"「艾丽妮」篇","updateTime":1651507200}]}
|
||||
@@ -61,6 +61,7 @@ async def test_fetch_new(
|
||||
"https://ak-conf.hypergryph.com/config/prod/announce_meta/IOS/preannouncement.meta.json"
|
||||
)
|
||||
monster_siren_router = respx.get("https://monster-siren.hypergryph.com/api/news")
|
||||
terra_list = respx.get("https://terra-historicus.hypergryph.com/api/recentUpdate")
|
||||
ak_list_router.mock(return_value=Response(200, json=arknights_list__1))
|
||||
detail_router.mock(
|
||||
return_value=Response(200, text=get_file("arknights-detail-807"))
|
||||
@@ -72,6 +73,7 @@ async def test_fetch_new(
|
||||
return_value=Response(200, json=get_json("arknights-pre-0.json"))
|
||||
)
|
||||
monster_siren_router.mock(return_value=Response(200, json=monster_siren_list_0))
|
||||
terra_list.mock(return_value=Response(200, json=get_json("terra-hist-0.json")))
|
||||
target = ""
|
||||
res = await arknights.fetch_new_post(target, [dummy_user_subinfo])
|
||||
assert ak_list_router.called
|
||||
@@ -90,7 +92,17 @@ async def test_fetch_new(
|
||||
assert len(post.pics) == 1
|
||||
# assert(post.pics == ['https://ak-fs.hypergryph.com/announce/images/20210623/e6f49aeb9547a2278678368a43b95b07.jpg'])
|
||||
print(res3[0][1])
|
||||
r = await post.generate_messages()
|
||||
await post.generate_messages()
|
||||
terra_list.mock(return_value=Response(200, json=get_json("terra-hist-1.json")))
|
||||
res = await arknights.fetch_new_post(target, [dummy_user_subinfo])
|
||||
assert len(res) == 1
|
||||
post = res[0][1][0]
|
||||
assert post.target_type == "terra-historicus"
|
||||
assert post.text == "123罗德岛!? - 「掠风」篇"
|
||||
assert post.url == "https://terra-historicus.hypergryph.com/comic/6253/episode/4938"
|
||||
assert post.pics == [
|
||||
"https://web.hycdn.cn/comic/pic/20220507/ab8a2ff408ec7d587775aed70b178ec0.png"
|
||||
]
|
||||
|
||||
|
||||
@pytest.mark.render
|
||||
@@ -116,6 +128,7 @@ async def test_send_with_render(
|
||||
"https://ak-conf.hypergryph.com/config/prod/announce_meta/IOS/preannouncement.meta.json"
|
||||
)
|
||||
monster_siren_router = respx.get("https://monster-siren.hypergryph.com/api/news")
|
||||
terra_list = respx.get("https://terra-historicus.hypergryph.com/api/recentUpdate")
|
||||
ak_list_router.mock(return_value=Response(200, json=arknights_list_0))
|
||||
detail_router.mock(
|
||||
return_value=Response(200, text=get_file("arknights-detail-805"))
|
||||
@@ -127,6 +140,7 @@ async def test_send_with_render(
|
||||
return_value=Response(200, json=get_json("arknights-pre-0.json"))
|
||||
)
|
||||
monster_siren_router.mock(return_value=Response(200, json=monster_siren_list_0))
|
||||
terra_list.mock(return_value=Response(200, json=get_json("terra-hist-0.json")))
|
||||
target = ""
|
||||
res = await arknights.fetch_new_post(target, [dummy_user_subinfo])
|
||||
assert ak_list_router.called
|
||||
|
||||
Reference in New Issue
Block a user