test(subscribeassistantenhanced): align subscribe test doubles - #362
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题与背景
MoviePilot
v2的订阅媒体身份契约已扩展为统一携带 TMDB、豆瓣、Bangumi、AniList 及通用媒体源字段。SubscribeAssistantEnhanced 的部分测试替身仍保持旧对象形状,导致调用主程序build_subscribe_meta()时抛出字段缺失异常,并连锁造成 8 项缺集相关测试失败。原因分析
SAE 生产代码已经复用主程序的统一 MetaInfo 构造入口,真实
Subscribe对象具备完整稳定字段;问题仅存在于两个SimpleNamespace测试替身。为不完整替身在生产代码中增加动态属性回退会掩盖仓内稳定对象契约,因此应由测试数据补齐字段。解决方案
doubanid、bangumiid、anilistid、media_source、media_id。影响与风险
build_subscribe_meta()的局部测试替身无需为本次场景扩充。验证
pytest tests/v2/subscribeassistantenhanced -q:1327 passed。tests/run.py -q:CI 工具 33 passed,V2 2185 passed。git diff --check通过。关联
v2下的全量测试基线;本 PR 合并后,fix(trafficassistant): support BrushFlow V5 tasks #361 将重新执行全量验证再进入发版。