generated from kgod/ai-review-template
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
|