Skip to content

Commit 0c3b87e

Browse files
committed
change tests add one for return
1 parent ff0a15c commit 0c3b87e

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

test_allocate.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,11 @@ def test_prefers_earlier_batches():
2828
assert earliest.available_quantity == 90
2929
assert medium.available_quantity == 100
3030
assert latest.available_quantity == 100
31+
32+
33+
def test_returns_allocated_batch_ref():
34+
in_stock_batch = Batch("in-stock-batch-ref", "HIGHBROW-POSTER", 100, eta=None)
35+
shipment_batch = Batch("shipment-batch-ref", "HIGHBROW-POSTER", 100, eta=tomorrow)
36+
line = OrderLine("oref", "HIGHBROW-POSTER", 10)
37+
allocation = allocate(line, [in_stock_batch, shipment_batch])
38+
assert allocation == "in-stock-batch"

0 commit comments

Comments
 (0)