generated from kgod/ai-review-template
自内部仓库剥离深度优化与 RAG 知识库后的交付版本: - Builder 对话式简历生成(FSM + 意图路由 LLM 兜底增强) - 条目级轻度优化:事实覆盖门禁 + STAR/bullet 修复链,功能/简介/成果与技术栈同级保护 - 简历导入:DOCX/PDF 解析、结构归一、手机号脱敏 - PostgreSQL 运行时 + Alembic 迁移链 Co-Authored-By: Claude <noreply@anthropic.com>
30 lines
921 B
Python
30 lines
921 B
Python
"""Characterization tests for optimization context anchoring."""
|
|
|
|
from app.optimization_flow import OptimizationFlowMixin
|
|
|
|
|
|
def test_context_carries_target_position_and_major():
|
|
session = {
|
|
"profile": {
|
|
"job_type": "校招",
|
|
"target_position": "数据分析师",
|
|
"anchor": {"major": "统计学"},
|
|
}
|
|
}
|
|
section = {"kind": "internship_experience"}
|
|
|
|
context = OptimizationFlowMixin._context(session, section, None)
|
|
|
|
assert context["target_position"] == "数据分析师"
|
|
assert context["major"] == "统计学"
|
|
assert context["entry_type"] == "internship_experience"
|
|
|
|
|
|
def test_context_tolerates_missing_target_position():
|
|
session = {"profile": {"job_type": "社招", "anchor": {}}}
|
|
section = {"kind": "work_experience"}
|
|
|
|
context = OptimizationFlowMixin._context(session, section, None)
|
|
|
|
assert context["target_position"] is None
|