# -*- coding: utf-8 -*- """ 全站独立页面精美视觉配图规范专项测试 (Dedicated Page Illustrations Test) 严格遵循 TDD 模式: 1. 验证软件定制独立页、APP定制独立页、智能体独立页、联系我们页均配有专属高品质现代中式矢量视窗图; 2. 验证所有图片文件真实存在于资源目录且尺寸有效; 3. 验证图片符合浅色专业风规范(背景 #FFFFFF/#F8FAFC、主色 #2563EB、无 emoji、有印章点缀与细线窗棂)。 """ import os import unittest ROOT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) class TestDedicatedPageIllustrations(unittest.TestCase): def setUp(self): self.img_dir = os.path.join(ROOT_DIR, 'public/assets/addons/official/images/showcases') self.template_dir = os.path.join(ROOT_DIR, 'addons/official/view/web') def test_illustration_assets_exist(self): """测试 4 张专属精美视觉插图文件存在且内容有效""" required_images = [ 'service_software_hero.svg', 'service_app_hero.svg', 'service_agent_hero.svg', 'contact_headquarters.svg', ] for img_name in required_images: path = os.path.join(self.img_dir, img_name) self.assertTrue(os.path.exists(path), f"缺少专属精美配图: {img_name}") with open(path, 'r', encoding='utf-8') as f: content = f.read() self.assertIn('