16 lines
675 B
Python
16 lines
675 B
Python
from app.services.shipping_notice.match import match_notice_lines
|
|
from app.services.shipping_notice.reservation_id import normalize_reservation_id
|
|
|
|
|
|
def test_match_numeric_reservation_id():
|
|
notice = [{"sku": "10-40594-001", "reservation_id": "1000140351", "qty": 2}]
|
|
inventory = [{"sku": "10-40594-001", "reservation_id": 1000140351.0, "available_qty": 3}]
|
|
status, results, _ = match_notice_lines(notice, inventory)
|
|
assert status == "fulfillable"
|
|
assert results[0]["reservation_id"] == "1000140351"
|
|
assert results[0]["available_qty"] == 3
|
|
|
|
|
|
def test_normalize_reservation_id_string():
|
|
assert normalize_reservation_id("1000140351") == "1000140351"
|