# -*- coding: utf-8 -*- """ 客户视角严谨度与大厂背书优化专项测试 (Client Rigor & Enterprise Trust Enhancements) 测试用例覆盖: 1. 标杆案例:具备微缩系统界面视窗/交互特征与联合终验背书 2. 资质合规:具备标准化权威认证编号(ISO9001/ISO27001/等保三级/国家软著登记号) 3. 演示沙箱:具备极速时效响应承诺(30分钟建联与7天专属脱敏沙箱) """ import os import re import unittest ROOT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) class TestClientRigorEnhancements(unittest.TestCase): def setUp(self): self.index_html_path = os.path.join(ROOT_DIR, 'addons/official/view/web/official_home/index.html') self.cases_html_path = os.path.join(ROOT_DIR, 'addons/official/view/web/official_case_show/list.html') self.about_html_path = os.path.join(ROOT_DIR, 'addons/official/view/web/official_home/single.html') self.about_mobile_path = os.path.join(ROOT_DIR, 'addons/official/view/web/official_home/single_e.html') self.product_html_path = os.path.join(ROOT_DIR, 'addons/official/view/web/official_product/product_page.html') with open(self.index_html_path, 'r', encoding='utf-8') as f: self.index_html = f.read() with open(self.cases_html_path, 'r', encoding='utf-8') as f: self.cases_html = f.read() with open(self.about_html_path, 'r', encoding='utf-8') as f: self.about_html = f.read() with open(self.about_mobile_path, 'r', encoding='utf-8') as f: self.about_mobile = f.read() with open(self.product_html_path, 'r', encoding='utf-8') as f: self.product_html = f.read() def test_case_interface_preview_and_acceptance(self): """案例提供界面资料或明确标注的业务结构示意,并说明验收方式。""" self.assertTrue('nhc-case-preview-window' in self.cases_html or '系统功能界面' in self.cases_html or '界面预览' in self.cases_html or '业务结构示意' in self.cases_html, "案例独立页必须提供界面资料或业务结构示意") # 必须包含客户终验与上线运行凭证 self.assertTrue('联合终验' in self.cases_html or '平稳运行' in self.cases_html or '验收' in self.cases_html, "案例独立页必须包含明确的验收与生产运行记录") def test_authoritative_certifications_and_copyright_numbers(self): """资质和软件权属应说明核验依据,不以示意徽章冒充认证。""" for content in (self.about_html, self.about_mobile): for label in ('企业主体', '计算机软件著作权', '第三方组件', '合同', 'ISO9001', 'ISO27001', '等保'): self.assertIn(label, content) self.assertIn('具体认证情况以有效证书为准', content) self.assertNotIn('cert_hi_tech.svg', content) self.assertNotIn('cert_iso9001.svg', content) def test_demo_sandbox_rigorous_commitment(self): """产品页演示沙箱必须具备极速建联与真实脱敏环境承诺""" self.assertTrue('30分钟' in self.product_html or '专属演示账号' in self.product_html or '脱敏' in self.product_html, "产品页沙箱必须承诺快速下发专属演示账号与脱敏数据环境") if __name__ == '__main__': unittest.main()