"""Display branding must not migrate storage or alter the public API.""" import ast import unittest from pathlib import Path ROOT = Path(__file__).resolve().parents[1] class TestBranding(unittest.TestCase): def test_titles(self): source = (ROOT / "app.py").read_text(encoding="utf-8") readme = (ROOT / "README.md").read_text(encoding="utf-8") self.assertIn('gr.Blocks(title="Anima Collection+ MCP")', source) self.assertIn('"# Anima Collection+ MCP\\n"', source) self.assertIn("title: Anima Collection+ MCP\n", readme) tree = ast.parse(source) credits = next(node.value for node in tree.body if isinstance(node, ast.Assign) and isinstance(node.targets[0], ast.Name) and node.targets[0].id == "PROJECT_CREDITS") self.assertIn("Anima Collection** をベース", ast.literal_eval(credits)) def test_export_and_legacy_storage(self): source = (ROOT / "assets/settings/settings.js").read_text(encoding="utf-8") self.assertIn('`anima-collection-plus-mcp-favorites-${props.family}.json`', source) self.assertIn('["anima-collection-plus-mcp-favorites", "imggen-favorites"].includes(data.format)', source) self.assertIn('`image-model-collection:settings:v1:${props.family}`', source) self.assertIn('`image-model-collection:favorites:v1:${props.family}`', source)