added asins to build_product_details
This commit is contained in:
1 parent
0275f94500
commit
9a34ae5ca6
2 files changed
+14
-2
No files matched your search
@@ -78,6 +78,17 @@ def test_promo_fields_read_through():
|
||||
assert product.metadata.percentage == 20
|
||||
|
||||
|
||||
def test_asin_reads_through():
|
||||
"""asin round-trips: convert_product_to_mongo writes it, so the consumer
|
||||
must read it back for the SellerAmp lookup"""
|
||||
product = build_product_details(_doc(asin="B0CHX3QBCH"), min_percentage=0)
|
||||
assert product.metadata.asin == "B0CHX3QBCH"
|
||||
|
||||
|
||||
def test_missing_asin_defaults_to_none():
|
||||
assert build_product_details(_doc(), min_percentage=0).metadata.asin is None
|
||||
|
||||
|
||||
def test_missing_promo_keys_default_to_none():
|
||||
"""a doc from a lagging monitor lacks promo keys -> None, not KeyError"""
|
||||
product = build_product_details(_doc(), min_percentage=0)
|
||||
|
||||
Reference in new issue
Block a user