mirror of
https://github.com/suyiiyii/nonebot-bison.git
synced 2026-05-09 18:27:56 +08:00
✨ 实现 Post.content 相关扩展协议 (#553)
* ✨ `post` 新增 `get_content()` 方法 * 🚨 make linter happy * 💄 auto fix by pre-commit hooks * 🐛 fix: 调整函数使用 * 💄 auto fix by pre-commit hooks * ✨ 转用函数处理文本 * 💄 auto fix by pre-commit hooks * 🔨 使用`Dict`存储`content_handlers` * 💄 auto fix by pre-commit hooks * 🎨 fix * :arts: 简化函数使用 * 🐛 移除`Theme`的过时参数 * 🗑️ 复用 `self.plain_content` * 💄 auto fix by pre-commit hooks * ✨ 注册式装饰器写法 * 💄 auto fix by pre-commit hooks * 🐛 fix * 💄 auto fix by pre-commit hooks * :feat: 通用纯文本处理函数 * 💄 auto fix by pre-commit hooks * :downgrade: 复用`==`处理标题 * 🎨 简化(?)写法 * ✅ 测试修复 * ♻️ via ContentSupport extensions * 🐛 fix test * 💄 auto fix by pre-commit hooks * 🐛 for clean text * 🐛 fix * 💄 auto fix by pre-commit hooks * fix: for xml * 💄 auto fix by pre-commit hooks * chore: art * 💄 auto fix by pre-commit hooks --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
感谢您对《明日方舟》的关注与支持。《明日方舟》将于08月01日10:00 ~16:00的更新维护中对游戏内【公开招募】进行新增干员。具体新增干员及标签强制刷新注意事项如下:
|
||||
公开招募新增干员:
|
||||
★★★★★★ 棘刺
|
||||
★★★★★ 安哲拉
|
||||
★★★★★ 贾维
|
||||
★★★★★ 蜜蜡
|
||||
★★★★ 孑
|
||||
注意:
|
||||
◆本次调整更新时,将对未开始进行招募的标签进行强制刷新
|
||||
◆本次调整更新时,处于已开始招募状态的标签将不受本次刷新影响
|
||||
◆为避免带来不必要的损失,请您在本次调整前尽快聘用您所招募的干员
|
||||
◆本次新增干员不加入调整更新时处于已开始招募状态的公开招募中
|
||||
◆本次强制刷新标签补偿:【招聘许可】*5、【加急许可】*5
|
||||
◆补偿发放时间:08月01日16:00
|
||||
◆补偿发放对象:08月01日16:00更新前所有注册并创建角色的玩家
|
||||
本次调整时间不排除延迟进行的可能,如若延迟则请关注官网发布的具体调整时间。更多后续内容及最新消息请关注《明日方舟》官网、官方微博及微信公众号。
|
||||
【明日方舟】运营组
|
||||
2023年07月23日
|
||||
+186
@@ -0,0 +1,186 @@
|
||||
==夏日嘉年华活动Part.1==
|
||||
一、「夏日嘉年华」,SideStory「火山旅梦」活动开启
|
||||
活动时间:08月01日 16:00 - 08月29日 03:59
|
||||
解锁条件:通关主线1-10
|
||||
活动说明:活动期间将开放「火山旅梦」活动,玩家可通过活动关卡作战、汐斯塔风情街、活动任务以及活动商店来获取活动奖励
|
||||
活动关卡将进行分段式开启:
|
||||
◆<第一段>
|
||||
开放时间:08月01日 16:00~08月22日 03:59
|
||||
开放关卡:
|
||||
【温泉假日】
|
||||
◆<第二段>
|
||||
开放时间:08月08日 16:00~08月22日 03:59
|
||||
开放关卡:
|
||||
【城市寻宝】
|
||||
◆<第三段>
|
||||
开放时间:08月15日 16:00~08月22日 03:59
|
||||
开放关卡:
|
||||
【岩浆冲浪】
|
||||
【汐斯塔风情街】
|
||||
活动说明:活动期间,玩家可在“汐斯塔风情街”中完成商品进货和商品售卖获取奖励
|
||||
主要奖励:峯联贸易物流补给(使用后随机获得指定养成素材)、【“纯白火山”之旅】家具(部分)、模组养成材料、高级养成素材、龙门币、作战记录等
|
||||
【多利的任务单】
|
||||
活动说明:活动期间,将开放【多利的任务单】,玩家可通过活动关卡作战等方式,完成【多利的任务单】中相关任务获取奖励
|
||||
主要奖励:活动干员【★★★★★:苍苔】、【“纯白火山”之旅】家具(部分)、「毛绒绒生物的毛」、模组养成材料等
|
||||
【“纯白火山”】
|
||||
开放时间:08月01日 16:00 - 08月29日 03:59
|
||||
兑换说明:活动期间,玩家可通过活动收集「毛绒绒生物的毛」,消耗「毛绒绒生物的毛」兑换【“纯白火山”】内物品
|
||||
主要奖励:【★★★★★:苍苔】信物、【“纯白火山”之旅】家具(部分)、寻访凭证、模组养成材料、高级养成素材、龙门币、作战记录、家具零件等
|
||||
|
||||
◆详细活动玩法介绍可关注后续官方微博相关内容
|
||||
◆本次活动期间【情报处理室】将无法浏览当期活动剧情,活动结束后该活动剧情将收录至【情报处理室】中
|
||||
二、「夏日嘉年华」,【云间清醒梦】限定寻访开启
|
||||
活动时间:08月01日 16:00 - 08月15日 03:59
|
||||
活动说明:活动期间【限定寻访·夏季】-【云间清醒梦】寻访开启,该寻访中以下干员出现率上升
|
||||
★★★★★★:纯烬艾雅法拉[限定] \ 琳琅诗怀雅(占6★出率的70%)
|
||||
★★★★★★:百炼嘉维尔 [限定] \ 假日威龙陈 [限定] (在6★剩余出率【30%】中以5倍权值出率提升)
|
||||
★★★★★:青枳(占5★出率的50%)
|
||||
注意:
|
||||
◆【云间清醒梦】为【限定寻访·夏季】系列寻访
|
||||
◆【限定寻访·夏季】寻访为【限定寻访】
|
||||
◆新增干员【琳琅诗怀雅】、【青枳】除加入【云间清醒梦】外,将在08月03日04:00后加入并常驻【标准寻访】卡池
|
||||
◆新增干员【纯烬艾雅法拉】为【限定寻访·夏季】限定干员,不会加入任何【标准寻访】
|
||||
◆限定干员【纯烬艾雅法拉】在本次寻访结束后,将不会在2024年07月01日前加入任何【限定寻访】
|
||||
◆注意:该限定寻访详细说明请参照相关卡池公告说明
|
||||
三、「夏日嘉年华」,特别登录活动开启
|
||||
活动时间:08月01日 16:00 - 08月15日 03:59
|
||||
活动说明:玩家在活动期间进行登录即可在活动页面中领取登录奖励:[云过天空寻访凭证]*1
|
||||
注意:
|
||||
◆[云过天空寻访凭证] 仅可用于限定寻访【云间清醒梦】中进行一次十连寻访
|
||||
◆该登录奖励活动期间内每个账号仅可领取一次
|
||||
◆[云过天空寻访凭证] 过期时间为:08月15日03:59
|
||||
四、「夏日嘉年华」,限定寻访每日赠送
|
||||
活动时间:08月01日 16:00 - 08月15日 03:59
|
||||
活动说明:活动期间,玩家每日可在【云间清醒梦】限定寻访中免费进行寻访一次
|
||||
注意:
|
||||
◆每日赠送寻访刷新时间为每日凌晨04:00
|
||||
◆未进行使用的“每日赠送寻访”将在每日凌晨04:00 进行刷新,无法进行累计
|
||||
五、「夏日嘉年华」新干员登场,信赖获取提升
|
||||
新增干员:
|
||||
★★★★★★:纯烬艾雅法拉[限定]
|
||||
★★★★★★:琳琅诗怀雅
|
||||
★★★★★:青枳
|
||||
★★★★★:苍苔
|
||||
注意:
|
||||
◆新增干员【苍苔】仅在本次「火山旅梦」活动中获取,暂不加入【云间清醒梦】、任何【标准寻访】及【中坚寻访】
|
||||
◆08月01日 16:00 - 08月22日 03:59期间以上新增干员在活动关卡内信赖获取提升
|
||||
六、「夏日嘉年华」,“氤氲奇境”签到活动开启
|
||||
活动时间:08月01日 16:00 - 08月15日 03:59
|
||||
活动说明:活动期间内,玩家累计活动签到10日可获得褐果专属时装、活动家具、 合成玉等活动奖励
|
||||
第一日:应急理智浓缩液*1、龙门币 *30000
|
||||
第二日:合成玉*200、招聘许可*5
|
||||
第三日:技巧概要·卷2*20、家具【“暖身浴”】*1
|
||||
第四日:芯片助剂*1、家具零件*300
|
||||
第五日:数据增补条*10、中级作战记录*20
|
||||
第六日:合成玉*200、赤金*20
|
||||
第七日:数据增补仪*3、技巧概要·卷3*8
|
||||
第八日:龙门币 *30000、时装【珊瑚海岸系列-“悠然假日 HDm57”-褐果】*1
|
||||
第九日:模组数据块*1、加急许可*5
|
||||
第十日:合成玉*200、中级作战记录*20
|
||||
注意:本次签到活动中领取的“应急理智浓缩液”到期时间请以游戏内显示为准
|
||||
七、「夏日嘉年华」,【汐斯塔涂鸦墙】活动开启
|
||||
活动时间:08月01日 16:00 - 08月15日 03:59
|
||||
活动说明:在活动期间玩家每日登录游戏后均可获得2次可选签数。在【汐斯塔涂鸦墙】中消耗可选签数来进行游戏。在选取的心动券中,心动券所对应的合成玉数量最多的1张心动券为当日最终奖励,玩家需要用尽当日可选签数选取心动券,方可领取奖励。
|
||||
注意事项:
|
||||
◆活动期间可进行抽取的天数最高为14个游戏日
|
||||
◆心动券中可出现的合成玉数量为以下几档:
|
||||
(合成玉*200 、合成玉*300 、合成玉*400 、合成玉*500 、合成玉*600、合成玉*800)
|
||||
◆当日心动券合成玉最终获得奖励不足400时(不含400),次日将增加一次可选签数。该次数不可累积叠加,玩家每日最多可获得的可选签数为3次(含每日登录赠送次数)
|
||||
◆当日所有可选签数将在次日凌晨04:00 进行刷新,无法累计
|
||||
八、「夏日嘉年华」,【珊瑚海岸】系列新装上架
|
||||
活动时间:08月01日 16:00 - 08月29日 03:59
|
||||
活动说明:活动期间以下干员新增时装将在时装商店上架并进行限时贩售:
|
||||
◆【珊瑚海岸】系列 -“悠然假日 HD26”- 百炼嘉维尔
|
||||
◆【珊瑚海岸】系列 -“夏卉 FA394”- 澄闪
|
||||
◆【珊瑚海岸】系列 -“夏卉 FA062”- 桃金娘
|
||||
九、「夏日嘉年华」,【珊瑚海岸】系列时装复刻上架
|
||||
贩售时间:08月01日 16:00 - 08月29日 03:59
|
||||
活动说明:活动期间以下干员复刻时装将在时装商店上架并进行限时贩售
|
||||
◆【珊瑚海岸】系列 -“夏卉 FA018”- 艾雅法拉
|
||||
◆【珊瑚海岸】系列 -“夏卉 FA017”- 安洁莉娜
|
||||
◆【珊瑚海岸】系列 -“静谧午夜 DN04”- 特米米
|
||||
◆【珊瑚海岸】系列 -“静谧午夜DN06”- 泥岩
|
||||
◆【珊瑚海岸】系列 -“轻风LB01”- 红
|
||||
◆【珊瑚海岸】系列 -“轻风LB03”- 铸铁
|
||||
◆【珊瑚海岸】系列 -“沙滩护卫GT002”- 孑
|
||||
十、「夏日嘉年华」,【万重山】时装特别复刻
|
||||
贩售时间:08月01日 16:00 - 08月29日 03:59
|
||||
活动说明:活动期间以下干员时装将在时装商店特别复刻并进行限时贩售
|
||||
◆【斗争血脉】系列 - “万重山” - 假日威龙陈
|
||||
十一、「夏日嘉年华」,【罗德岛风尚回顾】限时开启
|
||||
活动时间:08月01日 16:00 - 08月29日 03:59
|
||||
活动说明:活动期间,【斗争血脉系列 - “乌云” - 山】【斗争血脉系列 - “熔锻铸匠” - 森蚺】【音律联觉系列 - “爆裂菲林” - 煌】等84款干员时装将在时装商店复刻上架并进行限时贩售
|
||||
十二、「夏日嘉年华」,新增主题家具限时获取
|
||||
活动说明:活动期间新增活动限定家具【“求索者之梦”科考小屋】系列与【“纯白火山”之旅】系列
|
||||
【“求索者之梦”科考小屋】系列
|
||||
获取方式:
|
||||
◆家具商店售卖时间:08月01日 16:00 - 08月29日 03:59
|
||||
【“纯白火山”之旅】系列
|
||||
获取方式:
|
||||
◆「火山旅梦」活动奖励及兑换(部分)
|
||||
◆家具商店限时售卖(部分)
|
||||
◆家具商店售卖时间:08月01日 16:00 - 08月29日 03:59
|
||||
十三、「夏日嘉年华」,夏日组合包限时上架
|
||||
活动说明:「夏日嘉年华」活动开启后,采购中心将限时售卖以下组合包
|
||||
售卖时间:08月01日 16:00 - 08月29日 03:59
|
||||
【汐斯塔风物组合包】
|
||||
组合包内容:至纯源石*13、烧结核凝晶*2、双极纳米片*2、聚合凝胶*2、半自然溶剂*6
|
||||
【假日氤氲组合包】
|
||||
组合包内容:合成玉*4500、龙门币*100000、芯片助剂*2、技巧概要·卷1*80、模组数据块*2
|
||||
【温泉观光组合包】
|
||||
组合包内容:至纯源石*24、十连寻访凭证*2、龙门币*200000、高级作战记录*20、中级作战记录*30、芯片助剂*2、模组数据块*2、切削原液*4
|
||||
【火山狂欢组合包】
|
||||
组合包内容:至纯源石*90、十连寻访凭证*1、龙门币*220000、高级作战记录*30、芯片助剂*4、模组数据块*4、数据增补仪*20、数据增补条*60
|
||||
[诗怀雅的手提箱]
|
||||
组合包内容:至纯源石*16、龙门币*700000
|
||||
[特训意向礼包]
|
||||
组合包内容:至纯源石*11、资深干员特训装置*1
|
||||
资深干员特训装置:使用该特训装置后可选择一名已晋升至精英阶段2的5星干员直接升至精英阶段2,等级80。干员升级后不会返还已投入的养成资源。
|
||||
[高级特训意向礼包]
|
||||
组合包内容:至纯源石*19、高级资深干员特训装置*1
|
||||
高级资深干员特训装置:使用该特训装置后可选择一名已晋升至精英阶段2的6星干员直接升至精英阶段2,等级90。干员升级后不会返还已投入的养成资源。
|
||||
十四、「夏日嘉年华」,芯片&材料礼包上架
|
||||
【医疗芯片礼包】
|
||||
售卖时间:08月01日 16:00 - 08月29日 03:59
|
||||
组合包内容:医疗双芯片*4、医疗芯片*5、技巧概要·卷3*45、技巧概要·卷2*25、技巧概要·卷1*10
|
||||
【特种芯片礼包】
|
||||
售卖时间:08月01日 16:00 - 08月29日 03:59
|
||||
组合包内容:特种双芯片*4、特种芯片*5、技巧概要·卷3*45、技巧概要·卷2*25、技巧概要·卷1*10
|
||||
[每月材料自选组合包]
|
||||
售卖时间:08月01日 16:00起常驻售卖(每月限购两次)
|
||||
组合包内容:特级材料提货券*8、高级材料提货券*12
|
||||
特级材料提货券:使用后可获得任一特级品质精英材料
|
||||
高级材料提货券:使用后可获得任一高级品质精英材料
|
||||
注意:
|
||||
◆当月特级材料提货券与高级材料提货券过期时间为:次月10日 03:59
|
||||
◆特级材料提货券与高级材料提货券的材料可选范围会随后续材料种类更新而扩充
|
||||
十五、「夏日嘉年华」,【公开招募】干员更新
|
||||
更新时间:08月01日 16:00
|
||||
更新说明:更新后,以下干员将加入并常驻【公开招募】
|
||||
★★★★★★:棘刺
|
||||
★★★★★:安哲拉
|
||||
★★★★★:贾维
|
||||
★★★★★:蜜蜡
|
||||
★★★★:孑
|
||||
注意:
|
||||
本次【公开招募】干员更新时,将对未开始进行招募的标签进行强制刷新,强制刷新注意事项及相关补偿请参照官方相关更新公告
|
||||
==【珊瑚海岸系列 - “悠然假日 HD49” - 锡兰】==
|
||||
活动时间:08月18日 16:00 - 09月01日 03:59
|
||||
活动说明:活动期间【联合行动】特选干员定向寻访开启,该寻访卡池列表中六星干员与五星干员仅出现以下干员
|
||||
★★★★★★(6★出率:2%):鸿雪 / 斥罪 / 玛恩纳 / 老鲤
|
||||
★★★★★(5★出率:8%):极光 / 洋灰 / 赤冬 / 絮雨 / 和弦 / 玫拉
|
||||
注意:本次活动【联合行动】寻访为【标准寻访】
|
||||
三、「夏日嘉年华」,中坚甄选开启
|
||||
活动时间:08月24日 16:00 - 09月07日 03:59
|
||||
活动说明:活动期间,玩家可以在当期甄选的干员范围内自主选择并锁定2位六星干员和3位五星干员作为当期【中坚甄选】寻访出现概率提升的干员。相应地,原【高级凭证区】和【通用凭证区】内可兑换的【中坚寻访】中出率上升的干员,在【中坚甄选】期间将转变为:在当期【中坚甄选】寻访获得概率提升的干员范围内自行选定1位六星干员和1位五星干员进入【高级凭证区】和【通用凭证区】内可供兑换
|
||||
当期甄选的干员范围:
|
||||
★★★★★★(出率2%):能天使/安洁莉娜/风笛/闪灵/斯卡蒂/陈/赫拉格/煌/星熊/夜莺/阿/艾雅法拉
|
||||
★★★★★(出率8%):赫默/夜魔/天火/真理/槐琥/初雪/梅尔/守林人/白面鸮/临光/普罗旺斯/崖心/芙兰卡/蓝毒/雷蛇/可颂/食铁兽/苇草/布洛卡/灰喉/吽/惊蛰/慑砂/巫恋
|
||||
注意:【中坚甄选】会继承切换前的常驻【中坚寻访】六星干员获得概率
|
||||
四、【0011/韵】系列,新装限时上架
|
||||
活动时间:08月22日 04:00 - 09月05日 03:59
|
||||
活动说明:活动期间以下干员时装将在时装商店上架并进行限时贩售:
|
||||
◆【0011/韵】系列 -“棠云巧梦”- 子月
|
||||
更多活动内容请持续关注《明日方舟》游戏内公告及官方公告。
|
||||
【明日方舟】运营组
|
||||
2023年07月23日
|
||||
@@ -170,6 +170,7 @@ async def test_fetch_new(
|
||||
):
|
||||
from nonebot_bison.post import Post
|
||||
from nonebot_bison.types import Target, SubUnit
|
||||
from nonebot_bison.platform.arknights import ArknightsPost
|
||||
|
||||
ak_list_router = respx.get("https://ak-webview.hypergryph.com/api/game/bulletinList?target=IOS")
|
||||
detail_router = respx.get("https://ak-webview.hypergryph.com/api/game/bulletin/5716")
|
||||
@@ -201,7 +202,7 @@ async def test_fetch_new(
|
||||
res2 = await arknights.fetch_new_post(SubUnit(target, [dummy_user_subinfo]))
|
||||
assert len(res2[0][1]) == 1
|
||||
assert detail_router.called
|
||||
post2: Post = res2[0][1][0]
|
||||
post2: ArknightsPost = res2[0][1][0]
|
||||
assert post2.platform.platform_name == "arknights"
|
||||
assert post2.content
|
||||
assert post2.title == "2023「夏日嘉年华」限时活动即将开启"
|
||||
@@ -212,7 +213,9 @@ async def test_fetch_new(
|
||||
assert post2.timestamp
|
||||
assert "arknights" == post2.get_priority_themes()[0]
|
||||
# assert(post.pics == ['https://ak-fs.hypergryph.com/announce/images/20210623/e6f49aeb9547a2278678368a43b95b07.jpg'])
|
||||
|
||||
post2_plain_content = await post2.get_plain_content()
|
||||
assert post2_plain_content.strip() == get_file("arknights-plaintext-807.txt").strip()
|
||||
assert await post2.generate()
|
||||
terra_list.mock(return_value=Response(200, json=get_json("terra-hist-1.json")))
|
||||
res3 = await arknights.fetch_new_post(SubUnit(target, [dummy_user_subinfo]))
|
||||
assert len(res3) == 1
|
||||
@@ -236,8 +239,8 @@ async def test_send_with_render(
|
||||
monster_siren_list_0,
|
||||
monster_siren_list_1,
|
||||
):
|
||||
from nonebot_bison.post import Post
|
||||
from nonebot_bison.types import Target, SubUnit
|
||||
from nonebot_bison.platform.arknights import ArknightsPost
|
||||
|
||||
ak_list_router = respx.get("https://ak-webview.hypergryph.com/api/game/bulletinList?target=IOS")
|
||||
detail_router = respx.get("https://ak-webview.hypergryph.com/api/game/bulletin/8397")
|
||||
@@ -267,9 +270,12 @@ async def test_send_with_render(
|
||||
res2 = await arknights.fetch_new_post(SubUnit(target, [dummy_user_subinfo]))
|
||||
assert len(res2[0][1]) == 1
|
||||
assert detail_router.called
|
||||
post2: Post = res2[0][1][0]
|
||||
post2: ArknightsPost = res2[0][1][0]
|
||||
assert post2.platform.platform_name == "arknights"
|
||||
assert "《明日方舟》将于08月01日10:00 ~16:00的更新维护中对游戏内【公开招募】进行新增干员。" in post2.content
|
||||
assert post2.content
|
||||
post2_plain_content = await post2.get_plain_content()
|
||||
assert post2_plain_content.strip() == get_file("arknights-plaintext-805.txt").strip()
|
||||
assert await post2.generate()
|
||||
assert post2.title == "【公开招募】标签强制刷新通知"
|
||||
assert post2.nickname == "明日方舟游戏内公告"
|
||||
assert not post2.images
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
from time import time
|
||||
from typing import Any
|
||||
from inspect import cleandoc
|
||||
|
||||
import pytest
|
||||
from nonebug.app import App
|
||||
@@ -48,7 +49,7 @@ def mock_platform(app: App):
|
||||
async def parse(self, raw_post: "RawPost") -> "Post":
|
||||
return Post(
|
||||
self,
|
||||
raw_post["text"],
|
||||
content=raw_post["text"],
|
||||
url="http://t.tt/" + str(self.get_id(raw_post)),
|
||||
nickname="MockNick",
|
||||
)
|
||||
@@ -67,12 +68,15 @@ def mock_platform(app: App):
|
||||
async def test_display(mock_platform):
|
||||
from nonebot_bison.post import Post
|
||||
|
||||
post = Post(
|
||||
mock_platform,
|
||||
post1_content = cleandoc(
|
||||
"Rebum delenit iusto augue in rebum sanctus diam stet clita voluptua amet tempor sea in.\n"
|
||||
"Vel ullamcorper dolore clita eos amet tempor velit amet in.\n"
|
||||
"Vero hendrerit vero diam et lorem blandit ex diam ex amet.\n"
|
||||
"Voluptua et sed diam erat et diam lorem lorem no euismod sadipscing rebum feugiat est elitr autem.\n",
|
||||
)
|
||||
post1 = Post(
|
||||
mock_platform,
|
||||
content=post1_content,
|
||||
title="Ipsum consectetuer voluptua eirmod aliquyam dolore eu volutpat ipsum ipsum eirmod nulla.",
|
||||
images=[
|
||||
b"\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\x01\x00\x00\x00\x01\x08\x06\x00\x00\x00\x1f\x15\xc4\x89",
|
||||
@@ -87,8 +91,8 @@ async def test_display(mock_platform):
|
||||
description="Labore amet ut invidunt dolor consectetuer ipsum sadipscing sed minim diam rebum justo tincidunt.",
|
||||
)
|
||||
assert (
|
||||
str(post)
|
||||
== rf"""## Post: {id(post):X} ##
|
||||
str(post1)
|
||||
== rf"""## Post: {id(post1):X} ##
|
||||
|
||||
Rebum delenit iusto augue in rebum sanctus diam stet clita voluptua amet tempor sea in.
|
||||
Vel ullamcorper dolore clita eos amet tempor velit amet in.
|
||||
@@ -106,12 +110,16 @@ Vero hendrerit vero diam et lorem blandit ex diam ex...
|
||||
- description: 'Labore amet ut invidunt dolor consectetuer ipsum sadipscing sed minim diam rebum justo tincidunt.'
|
||||
"""
|
||||
) # noqa: E501
|
||||
post2 = Post(
|
||||
mock_platform,
|
||||
|
||||
post2_content = cleandoc(
|
||||
"Rebum delenit iusto augue in rebum sanctus diam stet clita voluptua amet tempor sea in.\n"
|
||||
"Vel ullamcorper dolore clita eos amet tempor velit amet in.\n"
|
||||
"Vero hendrerit vero diam et lorem blandit ex diam ex amet.\n"
|
||||
"Voluptua et sed diam erat et diam lorem lorem no euismod sadipscing rebum feugiat est elitr autem.\n",
|
||||
)
|
||||
post2 = Post(
|
||||
mock_platform,
|
||||
content=post2_content,
|
||||
title="Ipsum consectetuer voluptua eirmod aliquyam dolore eu volutpat ipsum ipsum eirmod nulla.",
|
||||
images=[
|
||||
b"\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\x01\x00\x00\x00\x01\x08\x06\x00\x00\x00\x1f\x15\xc4\x89",
|
||||
@@ -124,7 +132,7 @@ Vero hendrerit vero diam et lorem blandit ex diam ex...
|
||||
),
|
||||
nickname="Mock2",
|
||||
description="Labore amet ut invidunt dolor consectetuer ipsum sadipscing sed minim diam rebum justo tincidunt.",
|
||||
repost=post,
|
||||
repost=post1,
|
||||
)
|
||||
assert (
|
||||
str(post2)
|
||||
@@ -146,7 +154,7 @@ Vero hendrerit vero diam et lorem blandit ex diam ex...
|
||||
- description: 'Labore amet ut invidunt dolor consectetuer ipsum sadipscing sed minim diam rebum justo tincidunt.'
|
||||
|
||||
转发:
|
||||
## Post: {id(post):X} ##
|
||||
## Post: {id(post1):X} ##
|
||||
|
||||
Rebum delenit iusto augue in rebum sanctus diam stet clita voluptua amet tempor sea in.
|
||||
Vel ullamcorper dolore clita eos amet tempor velit amet in.
|
||||
|
||||
@@ -65,7 +65,7 @@ def mock_platform(app: App):
|
||||
async def parse(self, raw_post: "RawPost") -> "Post":
|
||||
return Post(
|
||||
self,
|
||||
raw_post["text"],
|
||||
content=raw_post["text"],
|
||||
url="http://t.tt/" + str(self.get_id(raw_post)),
|
||||
nickname="Mock",
|
||||
)
|
||||
@@ -88,7 +88,7 @@ def mock_post(app: App, mock_platform):
|
||||
|
||||
return Post(
|
||||
m := mock_platform(ProcessContext(DefaultClientManager())),
|
||||
"text",
|
||||
content="text",
|
||||
title="title",
|
||||
images=["http://t.tt/1.jpg"],
|
||||
timestamp=1234567890,
|
||||
@@ -98,7 +98,7 @@ def mock_post(app: App, mock_platform):
|
||||
description="description",
|
||||
repost=Post(
|
||||
m,
|
||||
"repost",
|
||||
content="repost",
|
||||
title="repost-title",
|
||||
images=["http://t.tt/2.jpg"],
|
||||
timestamp=1234567891,
|
||||
|
||||
Reference in New Issue
Block a user