@@ -13,6 +13,7 @@ def test_can_allocate_to_stock():
1313 order .allocate (stock , shipments = [])
1414
1515 assert order .allocation ['a-sku' ] == stock
16+ assert stock ['a-sku' ] == 990
1617
1718
1819def test_can_allocate_to_shipment ():
@@ -22,6 +23,7 @@ def test_can_allocate_to_shipment():
2223 order .allocate (stock = Stock ({}), shipments = [shipment ])
2324
2425 assert order .allocation ['a-sku' ] == shipment
26+ assert shipment ['a-sku' ] == 990
2527
2628
2729def test_ignores_irrelevant_stock ():
@@ -53,6 +55,8 @@ def test_allocates_to_stock_in_preference_to_shipment():
5355 order .allocate (stock , shipments = [shipment ])
5456
5557 assert order .allocation ['sku1' ] == stock
58+ assert stock ['sku1' ] == 990
59+ assert shipment ['sku1' ] == 1000
5660
5761
5862def test_can_allocate_multiple_lines_to_wh ():
@@ -62,6 +66,8 @@ def test_can_allocate_multiple_lines_to_wh():
6266 order .allocate (stock , shipments = [])
6367 assert order .allocation ['sku1' ] == stock
6468 assert order .allocation ['sku2' ] == stock
69+ assert stock ['sku1' ] == 995
70+ assert stock ['sku2' ] == 990
6571
6672
6773def test_can_allocate_multiple_lines_to_shipment ():
@@ -72,6 +78,8 @@ def test_can_allocate_multiple_lines_to_shipment():
7278
7379 assert order .allocation ['sku1' ] == shipment
7480 assert order .allocation ['sku2' ] == shipment
81+ assert shipment ['sku1' ] == 995
82+ assert shipment ['sku2' ] == 990
7583
7684
7785def test_can_allocate_to_both ():
@@ -83,6 +91,8 @@ def test_can_allocate_to_both():
8391
8492 assert order .allocation ['sku1' ] == stock
8593 assert order .allocation ['sku2' ] == shipment
94+ assert stock ['sku1' ] == 995
95+ assert shipment ['sku2' ] == 990
8696
8797
8898def test_can_allocate_to_both_preferring_stock ():
@@ -96,6 +106,11 @@ def test_can_allocate_to_both_preferring_stock():
96106 assert order .allocation ['sku2' ] == shipment
97107 assert order .allocation ['sku3' ] == stock
98108 assert order .allocation ['sku4' ] == stock
109+ assert shipment ['sku1' ] == 999
110+ assert shipment ['sku2' ] == 998
111+ assert shipment ['sku3' ] == 1000
112+ assert stock ['sku3' ] == 997
113+ assert stock ['sku4' ] == 996
99114
100115
101116def test_mixed_allocation_are_avoided_if_possible ():
0 commit comments