This commit is contained in:
@@ -2286,6 +2286,91 @@ def test_marketplace_matcher_sends_catalog_specific_variant_gaps_to_review():
|
||||
assert "variant_selection_review" in diagnostics.reasons
|
||||
|
||||
|
||||
def test_marketplace_matcher_blocks_scent_and_core_line_conflicts():
|
||||
from services.marketplace_product_matcher import score_marketplace_match
|
||||
|
||||
rolling_oil_scent_gap = score_marketplace_match(
|
||||
"【AUS LIFE 澳思萊】檸檬草滾珠精油 5.3ml",
|
||||
"【AUS LIFE澳思萊】茶樹滾珠精油5.3ml",
|
||||
)
|
||||
ingredient_gap = score_marketplace_match(
|
||||
"【NOW娜奧】純椰子油膏207ml-Now Foods",
|
||||
"【NOW 娜奧】Now Foods 純乳木果油油膏 207ml",
|
||||
)
|
||||
powder_line_gap = score_marketplace_match(
|
||||
"【港香蘭】漢本爽身粉100g/盒|誠意中西藥局",
|
||||
"【港香蘭】艾魔菈 草本爽身粉(100g/罐)",
|
||||
)
|
||||
|
||||
assert rolling_oil_scent_gap.hard_veto is True
|
||||
assert "aroma_scent_variant_conflict" in rolling_oil_scent_gap.reasons
|
||||
assert ingredient_gap.hard_veto is True
|
||||
assert "core_ingredient_line_conflict" in ingredient_gap.reasons
|
||||
assert powder_line_gap.hard_veto is True
|
||||
assert "branded_powder_line_conflict" in powder_line_gap.reasons
|
||||
|
||||
|
||||
def test_marketplace_matcher_sends_delimited_or_range_catalog_variants_to_review():
|
||||
from services.marketplace_product_matcher import score_marketplace_match
|
||||
|
||||
powder_case = score_marketplace_match(
|
||||
"【KATE 凱婷】零瑕肌密柔焦粉餅盒/極致零瑕光粉餅盒(單售粉盒)",
|
||||
"凱婷 極致零瑕光粉餅盒",
|
||||
)
|
||||
shu_brow = score_marketplace_match(
|
||||
"【Shu uemura 植村秀】武士刀眉筆(平輸航空版/多色任選/橡棕.暗灰. 灰棕)",
|
||||
"《Shu Uemura 植村秀》武士刀眉筆(H9) 4g -#橡棕06",
|
||||
)
|
||||
peripera_range = score_marketplace_match(
|
||||
"【peripera】韓國【PERIPERA 速描眼線膠筆 01~07】現貨 韓國境內版",
|
||||
"PERIPERA 速描眼線膠筆07淺玫粉",
|
||||
)
|
||||
jo_malone = score_marketplace_match(
|
||||
"【Jo Malone】車用擴香蕊芯1入 多款可選(國際航空版)",
|
||||
"JO MALONE 車用擴香蕊心-鼠尾草與海鹽 1入",
|
||||
)
|
||||
|
||||
for diagnostics in (powder_case, shu_brow, peripera_range, jo_malone):
|
||||
assert diagnostics.hard_veto is False
|
||||
assert diagnostics.score >= 0.76
|
||||
assert diagnostics.price_basis == "manual_review"
|
||||
assert diagnostics.alert_tier == "identity_review"
|
||||
assert "variant_selection_review" in diagnostics.reasons
|
||||
|
||||
|
||||
def test_marketplace_matcher_blocks_cleanser_lotion_line_conflict():
|
||||
from services.marketplace_product_matcher import score_marketplace_match
|
||||
|
||||
diagnostics = score_marketplace_match(
|
||||
"【Cetaphil 舒特膚】官方直營 三酸煥膚嫩亮修護乳473ml",
|
||||
"Cetaphil 舒特膚 三酸煥膚嫩亮潔膚露 473ml",
|
||||
)
|
||||
|
||||
assert diagnostics.hard_veto is True
|
||||
assert diagnostics.comparison_mode == "not_comparable"
|
||||
assert "cleanser_lotion_line_conflict" in diagnostics.reasons
|
||||
|
||||
|
||||
def test_marketplace_matcher_sends_single_sided_private_mousse_and_cream_variants_to_review():
|
||||
from services.marketplace_product_matcher import score_marketplace_match
|
||||
|
||||
private_mousse = score_marketplace_match(
|
||||
"【isLeaf】韓國女性私密防護慕絲250ml二款可選",
|
||||
"韓國isLeaf 女性私密防護慕絲250ml 花妍巧語",
|
||||
)
|
||||
cream_variant = score_marketplace_match(
|
||||
"【雪芙蘭】滋養霜60g(撫平粗糙 重現光滑)",
|
||||
"【雪芙蘭】滋養霜《清爽型》60g",
|
||||
)
|
||||
|
||||
for diagnostics in (private_mousse, cream_variant):
|
||||
assert diagnostics.hard_veto is False
|
||||
assert diagnostics.score >= 0.76
|
||||
assert diagnostics.price_basis == "manual_review"
|
||||
assert diagnostics.alert_tier == "identity_review"
|
||||
assert "variant_selection_review" in diagnostics.reasons
|
||||
|
||||
|
||||
def test_marketplace_matcher_promotes_eaoron_classic_tone_up_cream_exact_line():
|
||||
from services.marketplace_product_matcher import score_marketplace_match
|
||||
|
||||
|
||||
Reference in New Issue
Block a user