V10.421 guard marketplace line mismatches
This commit is contained in:
@@ -1410,6 +1410,50 @@ def test_marketplace_matcher_rejects_dr_hsieh_labsmart_vs_repair_serum_line_gap(
|
||||
assert "dr_hsieh_labsmart_line_conflict" not in same_line.reasons
|
||||
|
||||
|
||||
def test_marketplace_matcher_rejects_kanebo_milano_powder_vs_perfume_type_gap():
|
||||
from services.marketplace_product_matcher import score_marketplace_match
|
||||
|
||||
diagnostics = score_marketplace_match(
|
||||
"【Kanebo 佳麗寶】Milano Collection 2024絕色蜜粉餅GR 30g",
|
||||
"Kanebo Milano Collection 2026 絕色香水30mL",
|
||||
momo_price=3500,
|
||||
competitor_price=2900,
|
||||
)
|
||||
|
||||
assert diagnostics.score < 0.76
|
||||
assert diagnostics.hard_veto is True
|
||||
assert diagnostics.comparison_mode == "not_comparable"
|
||||
assert "kanebo_milano_type_conflict" in diagnostics.reasons
|
||||
|
||||
same_powder = score_marketplace_match(
|
||||
"【Kanebo 佳麗寶】Milano Collection 2024絕色蜜粉餅GR 30g",
|
||||
"Kanebo Milano Collection 2024 絕色蜜粉餅 GR 30g",
|
||||
)
|
||||
assert "kanebo_milano_type_conflict" not in same_powder.reasons
|
||||
|
||||
|
||||
def test_marketplace_matcher_rejects_hoi_candle_product_line_gap():
|
||||
from services.marketplace_product_matcher import score_marketplace_match
|
||||
|
||||
diagnostics = score_marketplace_match(
|
||||
"【hoi! 好好生活】日京山風香氛天然蠟燭150g",
|
||||
"hoi!LAB 實驗室香氛天然大豆香氛蠟燭經典篇 150g",
|
||||
momo_price=780,
|
||||
competitor_price=699,
|
||||
)
|
||||
|
||||
assert diagnostics.score < 0.76
|
||||
assert diagnostics.hard_veto is True
|
||||
assert diagnostics.comparison_mode == "not_comparable"
|
||||
assert "hoi_candle_line_conflict" in diagnostics.reasons
|
||||
|
||||
same_line = score_marketplace_match(
|
||||
"【hoi! 好好生活】日京山風香氛天然蠟燭150g",
|
||||
"hoi! 日京山風 香氛天然蠟燭 150g",
|
||||
)
|
||||
assert "hoi_candle_line_conflict" not in same_line.reasons
|
||||
|
||||
|
||||
def test_marketplace_matcher_rejects_refill_core_vs_case_only_pack():
|
||||
from services.marketplace_product_matcher import score_marketplace_match
|
||||
|
||||
|
||||
Reference in New Issue
Block a user