Files
WeChatDataAnalysis/tests/test_wrapped_manifest_bento_summary.py
2977094657 3072297769 feat(wrapped): 新增便当总览卡片(Card #7)
- 增加 Card07BentoSummary 前端渲染与加载/失败重试交互(注入 wrappedRetryCard)

- 后端新增 card_07_bento_summary:基于已实现卡片聚合生成 snapshot,保证渲染稳定

- Wrapped manifest/implemented_upto 升级到 7,并支持按卡片 id 单独构建

- 新增 manifest 末尾卡片校验测试
2026-02-26 18:29:48 +08:00

29 lines
1.0 KiB
Python

import sys
import unittest
from pathlib import Path
# Ensure "src/" is importable when running tests from repo root.
ROOT = Path(__file__).resolve().parents[1]
sys.path.insert(0, str(ROOT / "src"))
class TestWrappedManifestBentoSummary(unittest.TestCase):
def test_manifest_appends_bento_summary(self):
try:
from wechat_decrypt_tool.wrapped.service import _WRAPPED_CARD_MANIFEST
except ModuleNotFoundError as e:
# Some dev/test environments may not have optional deps installed (e.g. pypinyin).
# The manifest itself doesn't depend on them, but importing the service module does.
if getattr(e, "name", "") == "pypinyin":
self.skipTest("pypinyin is not installed")
raise
self.assertTrue(len(_WRAPPED_CARD_MANIFEST) > 0)
last = _WRAPPED_CARD_MANIFEST[-1]
self.assertEqual(int(last.get("id")), 7)
self.assertEqual(str(last.get("kind")), "global/bento_summary")
if __name__ == "__main__":
unittest.main()