This commit is contained in:
@@ -2344,6 +2344,47 @@ def test_marketplace_matcher_sends_catalog_specific_variant_gaps_to_review():
|
||||
assert "variant_selection_review" in diagnostics.reasons
|
||||
|
||||
|
||||
def test_marketplace_matcher_sends_legacy_gate_pass_risks_to_review():
|
||||
from services.marketplace_product_matcher import score_marketplace_match
|
||||
|
||||
cases = [
|
||||
(
|
||||
"【NARS】官方直營 妝點甜心遮瑕蜜(任選)",
|
||||
"NARS 妝點甜心遮瑕蜜 1.4ml 多款可選",
|
||||
"makeup_catalog_selection_gap",
|
||||
),
|
||||
(
|
||||
"【LOREAL Paris 巴黎萊雅】玻尿酸瞬效保濕修護晶露2入組(啵啵精華水/液態紫熨斗/保濕)",
|
||||
"(2入組)【LOREAL Paris 巴黎萊雅】玻尿酸瞬效保濕水光精華 30ml",
|
||||
"loreal_serum_variant_gap",
|
||||
),
|
||||
(
|
||||
"【SEBAMED 施巴】洗髮乳1000ml+安絲洗髮乳400ml(總代理)",
|
||||
"施巴5.5 sebamed (溫和/油性抗屑)洗髮乳1000ml任選x1+安絲洗髮乳400ml",
|
||||
"sebamed_shampoo_variant_catalog_gap",
|
||||
),
|
||||
(
|
||||
"【Schick 舒適牌】舒綺美型刀 除毛刀(1刀把1刀片)",
|
||||
"【Schick 舒適牌】舒綺2-in-1美型刀 ( 1刀把1刀片 )",
|
||||
"schick_2in1_model_gap",
|
||||
),
|
||||
(
|
||||
"【TAICEND 泰陞】寶貝液體保護膜(70ml)",
|
||||
"【TAICEND泰陞】皮膚保護噴霧(70ml)",
|
||||
"taicend_protection_form_gap",
|
||||
),
|
||||
]
|
||||
|
||||
for momo_name, competitor_name, expected_reason in cases:
|
||||
diagnostics = score_marketplace_match(momo_name, competitor_name)
|
||||
assert diagnostics.score >= 0.76
|
||||
assert diagnostics.hard_veto is False
|
||||
assert diagnostics.price_basis == "manual_review"
|
||||
assert diagnostics.alert_tier == "identity_review"
|
||||
assert "variant_selection_review" in diagnostics.reasons
|
||||
assert expected_reason in diagnostics.reasons
|
||||
|
||||
|
||||
def test_marketplace_matcher_blocks_scent_and_core_line_conflicts():
|
||||
from services.marketplace_product_matcher import score_marketplace_match
|
||||
|
||||
|
||||
Reference in New Issue
Block a user