1) 客服 Agent 四份交付文档 + 构建脚手架:品牌由包装占位 XX科技 / 旧名 南方财富 统一为南方基金(热线 400-889-8899 / 官网 nffund.com),系统名改为「智能服务系统」; 同步追加 §0.4 修订记录行,工程记录行保留原占位字面以支撑硬编码扫描验收。 2) 开发文档:清理 28 份已作废/残留文档(14 份移出归档 + 14 份仓库副本), 新增《文档规整方案与开发前待决事项-2026-09-17》。 3) 客服agent 四份交付文档首次纳入本分支。
42 lines
1.2 KiB
Python
42 lines
1.2 KiB
Python
from pathlib import Path
|
|
|
|
import pytest
|
|
|
|
from app.service.promotion_image_service import PromotionImageService
|
|
|
|
|
|
def test_background_prompt_forbids_content_reconstruction() -> None:
|
|
prompt = PromotionImageService._build_prompt(
|
|
style_code="balanced_allocation",
|
|
background_theme="data_lines",
|
|
fund_type="混合型",
|
|
)
|
|
|
|
assert "不生成任何文字、数字、字母" in prompt
|
|
assert "Logo" in prompt
|
|
|
|
|
|
@pytest.mark.asyncio
|
|
async def test_disabled_image_service_returns_none(monkeypatch: pytest.MonkeyPatch) -> None:
|
|
class Settings:
|
|
promotion_image_enabled = False
|
|
promotion_image_base_url = "https://dashscope.aliyuncs.com"
|
|
promotion_image_model = "wan2.2-t2i-flash"
|
|
promotion_image_timeout_seconds = 90
|
|
promotion_image_poll_interval_seconds = 2
|
|
|
|
monkeypatch.setattr(
|
|
"app.service.promotion_image_service.get_settings",
|
|
lambda: Settings(),
|
|
)
|
|
service = PromotionImageService()
|
|
|
|
result = await service.generate_background(
|
|
output_path=Path("unused.png"),
|
|
style_code="balanced_allocation",
|
|
background_theme="data_lines",
|
|
fund_type="混合型",
|
|
)
|
|
|
|
assert result is None
|