Fix normalized quantity basis
This commit is contained in:
@@ -264,6 +264,26 @@ class CostcoPipelineTests(unittest.TestCase):
|
||||
self.assertEqual("6", row["normalized_quantity"])
|
||||
self.assertEqual("count", row["normalized_quantity_unit"])
|
||||
|
||||
volume_row = enrich_costco.parse_costco_item(
|
||||
order_id="abc",
|
||||
order_date="2026-03-12",
|
||||
raw_path=Path("costco_output/raw/abc.json"),
|
||||
line_no=3,
|
||||
item={
|
||||
"itemNumber": "1185912",
|
||||
"itemDescription01": "KS ALMND BAR US 1.74QTS CN",
|
||||
"itemDescription02": None,
|
||||
"itemDepartmentNumber": 18,
|
||||
"transDepartmentNumber": 18,
|
||||
"unit": 2,
|
||||
"itemIdentifier": "E",
|
||||
"amount": 21.98,
|
||||
"itemUnitPriceAmount": 10.99,
|
||||
},
|
||||
)
|
||||
self.assertEqual("3.48", volume_row["normalized_quantity"])
|
||||
self.assertEqual("qt", volume_row["normalized_quantity_unit"])
|
||||
|
||||
discount = enrich_costco.parse_costco_item(
|
||||
order_id="abc",
|
||||
order_date="2026-03-12",
|
||||
|
||||
Reference in New Issue
Block a user