This commit is contained in:
@@ -49,6 +49,19 @@ def test_competitor_ppt_results_keep_pending_diagnostics_in_export():
|
||||
assert "\"unit_comparison\"" in source
|
||||
assert "build_unit_price_comparison" in source
|
||||
assert "(vc.pchome_price IS NULL)" in source
|
||||
assert "(lm.momo_price - vc.pchome_price) AS price_diff" in source
|
||||
assert "((lm.momo_price - vc.pchome_price) / vc.pchome_price * 100) AS price_diff_pct" in source
|
||||
|
||||
|
||||
def test_competitor_ppt_and_ai_use_momo_minus_pchome_gap_direction():
|
||||
ppt_source = (ROOT / "services" / "ppt_generator.py").read_text(encoding="utf-8")
|
||||
route_source = (ROOT / "routes" / "openclaw_bot_routes.py").read_text(encoding="utf-8")
|
||||
|
||||
assert 'pc_wins = [r for r in found if r.get("price_diff", 0) > 10]' in ppt_source
|
||||
assert 'mo_wins = [r for r in found if r.get("price_diff", 0) < -10]' in ppt_source
|
||||
assert "平均價差 {avg_pct:+.1f}%(momo - PChome)" in ppt_source
|
||||
assert "price_diff = MOMO售價 − PChome售價" in route_source
|
||||
assert "正值=MOMO較貴、PChome低價壓力" in route_source
|
||||
|
||||
|
||||
def test_competitor_review_queue_is_canonical_unit_price_handoff():
|
||||
|
||||
Reference in New Issue
Block a user