66 Line ,
77 OrderLine ,
88 Shipment ,
9- Stock ,
109 allocate ,
1110)
1211
@@ -22,9 +21,9 @@ def test_can_allocate_to_warehouse_stock():
2221 order = [
2322 OrderLine (sku = sku , quantity = 10 ),
2423 ]
25- stock = Stock (sku = sku , quantity = 1000 )
24+ stock = [ Line (sku = sku , quantity = 1000 )]
2625
27- allocate (order , [ stock ] , shipments = [])
26+ allocate (order , stock , shipments = [])
2827
2928 assert order [0 ].allocation == 'warehouse'
3029
@@ -48,12 +47,12 @@ def test_ignores_invalid_stock():
4847 order = [
4948 OrderLine (sku = sku1 , quantity = 10 ),
5049 ]
51- stock = Stock (sku = sku2 , quantity = 1000 )
50+ stock = [ Line (sku = sku2 , quantity = 1000 )]
5251 shipment = Shipment (id = random_id (), eta = date .today (), lines = [
5352 Line (sku = sku1 , quantity = 1000 ),
5453 ])
5554
56- allocate (order , stock = [ stock ] , shipments = [shipment ])
55+ allocate (order , stock = stock , shipments = [shipment ])
5756
5857 assert order [0 ].allocation == shipment .id
5958
@@ -80,12 +79,12 @@ def test_allocates_to_warehouse_stock_in_preference_to_shipment():
8079 order = [
8180 OrderLine (sku = sku , quantity = 10 ),
8281 ]
83- stock = Stock (sku = sku , quantity = 1000 )
82+ stock = [ Line (sku = sku , quantity = 1000 )]
8483 shipment = Shipment (id = random_id (), eta = date .today (), lines = [
8584 Line (sku = sku , quantity = 1000 ),
8685 ])
8786
88- allocate (order , [ stock ] , shipments = [shipment ])
87+ allocate (order , stock , shipments = [shipment ])
8988
9089 assert order [0 ].allocation == 'warehouse'
9190
@@ -97,8 +96,8 @@ def test_can_allocate_multiple_lines_to_wh():
9796 OrderLine (sku = sku2 , quantity = 10 ),
9897 ]
9998 stock = [
100- Stock (sku = sku1 , quantity = 1000 ),
101- Stock (sku = sku2 , quantity = 1000 ),
99+ Line (sku = sku1 , quantity = 1000 ),
100+ Line (sku = sku2 , quantity = 1000 ),
102101 ]
103102
104103 allocate (order , stock , shipments = [])
@@ -132,9 +131,7 @@ def test_can_allocate_to_both():
132131 shipment = Shipment (id = random_id (), eta = date .today (), lines = [
133132 Line (sku = sku2 , quantity = 1000 ),
134133 ])
135- stock = [
136- Stock (sku = sku1 , quantity = 1000 ),
137- ]
134+ stock = [Line (sku = sku1 , quantity = 1000 )]
138135
139136 allocate (order , stock , shipments = [shipment ])
140137
@@ -156,8 +153,8 @@ def test_can_allocate_to_both_preferring_stock():
156153 Line (sku = sku3 , quantity = 1000 ),
157154 ])
158155 stock = [
159- Stock (sku = sku3 , quantity = 1000 ),
160- Stock (sku = sku4 , quantity = 1000 ),
156+ Line (sku = sku3 , quantity = 1000 ),
157+ Line (sku = sku4 , quantity = 1000 ),
161158 ]
162159
163160 allocate (order , stock , shipments = [shipment ])
0 commit comments