114 行
6.6 KiB
Python
114 行
6.6 KiB
Python
# -*- coding: utf-8 -*-
|
||
"""
|
||
纯粹务实工程文案专项测试 (Natural Copywriting & No AI Buzzwords Test)
|
||
测试驱动去 AI 化、去除泛化通用口号与翻译腔,强化大厂务实工程与业务场景语言。
|
||
"""
|
||
import os
|
||
import unittest
|
||
|
||
ROOT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
||
|
||
class TestNaturalCopywriting(unittest.TestCase):
|
||
|
||
def setUp(self):
|
||
self.index_path = os.path.join(ROOT_DIR, 'addons/official/view/web/official_home/index.html')
|
||
self.services_path = os.path.join(ROOT_DIR, 'addons/official/view/web/official_product/service_page.html')
|
||
self.products_path = os.path.join(ROOT_DIR, 'addons/official/view/web/official_product/product_page.html')
|
||
self.cases_path = os.path.join(ROOT_DIR, 'addons/official/view/web/official_case_show/list.html')
|
||
self.about_path = os.path.join(ROOT_DIR, 'addons/official/view/web/official_home/single.html')
|
||
self.contact_path = os.path.join(ROOT_DIR, 'addons/official/view/web/official_online_message/list.html')
|
||
|
||
with open(self.index_path, 'r', encoding='utf-8') as f:
|
||
self.index_html = f.read()
|
||
with open(self.services_path, 'r', encoding='utf-8') as f:
|
||
self.services_html = f.read()
|
||
with open(self.products_path, 'r', encoding='utf-8') as f:
|
||
self.products_html = f.read()
|
||
with open(self.cases_path, 'r', encoding='utf-8') as f:
|
||
self.cases_html = f.read()
|
||
with open(self.about_path, 'r', encoding='utf-8') as f:
|
||
self.about_html = f.read()
|
||
with open(self.contact_path, 'r', encoding='utf-8') as f:
|
||
self.contact_html = f.read()
|
||
|
||
def test_forbid_ai_buzzwords_and_translationese(self):
|
||
"""严格禁止典型 AI 假大空口号、翻译腔与泛化套话"""
|
||
self.footer_path = os.path.join(ROOT_DIR, 'addons/official/view/web/official_common/pc/footer.html')
|
||
with open(self.footer_path, 'r', encoding='utf-8') as f:
|
||
self.footer_html = f.read()
|
||
|
||
ai_buzzwords = [
|
||
'准备好与资深技术架构师展开深度研讨了吗', # 翻译腔
|
||
'认知智能化”跃迁', # 虚浮AI词
|
||
'数字见证力量', # 泛化套话
|
||
'开启确定性数字化未来', # 泛化套话
|
||
'让您的企业也拥有经得起考验的', # AI祈使句
|
||
'开启您的企业数字化与智能化升级项目', # 泛化套话
|
||
'开启确定性数字化技术合作', # 虚词
|
||
'严谨商务 · 现代中式 · 高级感专业软件服务', # 泄露的设计Prompt
|
||
'现代中式 · 高级感',
|
||
'研发委员会',
|
||
'技术委员会',
|
||
'原创技术资产',
|
||
'工程受控说明',
|
||
'白盒交付',
|
||
'白盒源码',
|
||
'带病代码',
|
||
'杜绝系统带病上线',
|
||
'西南数谷',
|
||
]
|
||
all_html = (
|
||
self.index_html + "\n" +
|
||
self.services_html + "\n" +
|
||
self.products_html + "\n" +
|
||
self.cases_html + "\n" +
|
||
self.about_html + "\n" +
|
||
self.contact_html + "\n" +
|
||
self.footer_html
|
||
)
|
||
for buzzword in ai_buzzwords:
|
||
self.assertNotIn(buzzword, all_html, f"全站必须彻底剔除 AI 通用套话/提示词残留: '{buzzword}'")
|
||
|
||
def test_require_pragmatic_engineering_copy(self):
|
||
"""必须包含具体务实的工程化、场景化语言"""
|
||
# 首页务实表达
|
||
self.assertIn('扎实的软件工程实践', self.index_html, "首页服务板块标题必须务实直接")
|
||
self.assertIn('四大成熟商用系统', self.index_html, "首页产品板块标题必须清晰明确")
|
||
self.assertIn('用生产环境数据说话', self.index_html, "首页案例板块必须务实接地气")
|
||
self.assertIn('受控的软件研发流程', self.index_html, "首页流程板块标题必须强调受控确定性")
|
||
self.assertIn('来自甲方的真实反馈', self.index_html, "首页评价板块标题必须务实")
|
||
self.assertIn('有具体的系统研发或产品选型需求?我们来落实', self.index_html, "首页CTA必须说人话、重落实")
|
||
|
||
# 服务页务实表达
|
||
self.assertIn('带着您的系统需求或技术难题,直接与架构师沟通', self.services_html, "服务页CTA必须杜绝翻译腔")
|
||
|
||
# 案例页务实表达
|
||
self.assertIn('面临类似的业务系统瓶颈?我们可以提供针对性方案', self.cases_html, "案例页CTA必须直面业务痛点")
|
||
|
||
# 关于我们与联系我们
|
||
self.assertIn('找懂业务、讲规范的研发团队,让软件项目平稳落地', self.about_html, "关于我们CTA必须务实接地气")
|
||
self.assertIn('业务咨询与技术评估', self.contact_html, "联系我们标题必须清晰务实")
|
||
|
||
def test_user_removal_of_copyright_metric_in_hero(self):
|
||
"""首屏Hero必须彻底移除用户指明的'50+ 国家软件著作权资产'"""
|
||
self.assertNotIn('国家软件著作权资产', self.index_html, "首屏Hero严禁包含用户要求去掉的'国家软件著作权资产'")
|
||
|
||
def test_user_removal_of_cases_data_wall(self):
|
||
"""案例独立页(PC与移动端)必须彻底移除'50亿+ 交易额'等悬浮泛化数字指标墙"""
|
||
# PC端
|
||
self.assertNotIn('nhc-case-metrics-section', self.cases_html, "PC案例页必须彻底移除成果数据指标墙大板块")
|
||
self.assertNotIn('系统累计支撑交易额', self.cases_html, "PC案例页严禁展示浮夸的'系统累计支撑交易额'")
|
||
self.assertNotIn('标杆政企与行业组织', self.cases_html, "PC案例页严禁展示浮夸的'标杆政企与行业组织'")
|
||
self.assertNotIn('项目按期高质量交付率', self.cases_html, "PC案例页严禁展示浮夸的'项目按期高质量交付率'")
|
||
|
||
# 移动端
|
||
mobile_path = os.path.join(ROOT_DIR, 'addons/official/view/web/official_case_show/list_e.html')
|
||
with open(mobile_path, 'r', encoding='utf-8') as f:
|
||
mobile_html = f.read()
|
||
self.assertNotIn('支撑交易总额', mobile_html, "移动端案例页严禁展示'支撑交易总额'")
|
||
self.assertNotIn('标杆合作组织', mobile_html, "移动端案例页严禁展示'标杆合作组织'")
|
||
self.assertNotIn('按期交付率', mobile_html, "移动端案例页严禁展示'按期交付率'")
|
||
|
||
if __name__ == '__main__':
|
||
unittest.main()
|