@@ -7,7 +7,7 @@ def test_can_allocate_to_stock():
77
88 order .allocate (stock , shipments = [])
99
10- assert order .allocations ['a-sku' ] == stock
10+ assert order .allocation ['a-sku' ] == stock
1111
1212
1313def test_can_allocate_to_shipment ():
@@ -16,7 +16,7 @@ def test_can_allocate_to_shipment():
1616
1717 order .allocate (stock = Stock ({}), shipments = [shipment ])
1818
19- assert order .allocations ['a-sku' ] == shipment
19+ assert order .allocation ['a-sku' ] == shipment
2020
2121
2222def test_ignores_irrelevant_stock ():
@@ -26,7 +26,7 @@ def test_ignores_irrelevant_stock():
2626
2727 order .allocate (stock = stock , shipments = [shipment ])
2828
29- assert order .allocations ['sku1' ] == shipment
29+ assert order .allocation ['sku1' ] == shipment
3030
3131
3232
@@ -37,7 +37,7 @@ def test_can_allocate_to_correct_shipment():
3737
3838 order .allocate (stock = Stock ({}), shipments = [shipment1 , shipment2 ])
3939
40- assert order .allocations ['sku2' ] == shipment2
40+ assert order .allocation ['sku2' ] == shipment2
4141
4242
4343def test_allocates_to_stock_in_preference_to_shipment ():
@@ -47,16 +47,16 @@ def test_allocates_to_stock_in_preference_to_shipment():
4747
4848 order .allocate (stock , shipments = [shipment ])
4949
50- assert order .allocations ['sku1' ] == stock
50+ assert order .allocation ['sku1' ] == stock
5151
5252
5353def test_can_allocate_multiple_lines_to_wh ():
5454 order = Order ({'sku1' : 5 , 'sku2' : 10 })
5555 stock = Stock ({'sku1' : 1000 , 'sku2' : 1000 })
5656
5757 order .allocate (stock , shipments = [])
58- assert order .allocations ['sku1' ] == stock
59- assert order .allocations ['sku2' ] == stock
58+ assert order .allocation ['sku1' ] == stock
59+ assert order .allocation ['sku2' ] == stock
6060
6161
6262def test_can_allocate_multiple_lines_to_shipment ():
@@ -65,8 +65,8 @@ def test_can_allocate_multiple_lines_to_shipment():
6565
6666 order .allocate (stock = Stock ({}), shipments = [shipment ])
6767
68- assert order .allocations ['sku1' ] == shipment
69- assert order .allocations ['sku2' ] == shipment
68+ assert order .allocation ['sku1' ] == shipment
69+ assert order .allocation ['sku2' ] == shipment
7070
7171
7272def test_can_allocate_to_both ():
@@ -76,8 +76,8 @@ def test_can_allocate_to_both():
7676
7777 order .allocate (stock , shipments = [shipment ])
7878
79- assert order .allocations ['sku1' ] == stock
80- assert order .allocations ['sku2' ] == shipment
79+ assert order .allocation ['sku1' ] == stock
80+ assert order .allocation ['sku2' ] == shipment
8181
8282
8383def test_can_allocate_to_both_preferring_stock ():
@@ -87,22 +87,22 @@ def test_can_allocate_to_both_preferring_stock():
8787
8888 order .allocate (stock , shipments = [shipment ])
8989
90- assert order .allocations ['sku1' ] == shipment
91- assert order .allocations ['sku2' ] == shipment
92- assert order .allocations ['sku3' ] == stock
93- assert order .allocations ['sku4' ] == stock
90+ assert order .allocation ['sku1' ] == shipment
91+ assert order .allocation ['sku2' ] == shipment
92+ assert order .allocation ['sku3' ] == stock
93+ assert order .allocation ['sku4' ] == stock
9494
9595
9696
97- def test_mixed_allocations_are_avoided_if_possible ():
97+ def test_mixed_allocation_are_avoided_if_possible ():
9898 order = Order ({'sku1' : 10 , 'sku2' : 10 })
9999 shipment = Stock ({'sku1' : 1000 , 'sku2' : 1000 })
100100 stock = Stock ({'sku1' : 1000 })
101101
102102 order .allocate (stock , shipments = [shipment ])
103103
104- assert order .allocations ['sku1' ] == shipment
105- assert order .allocations ['sku2' ] == shipment
104+ assert order .allocation ['sku1' ] == shipment
105+ assert order .allocation ['sku2' ] == shipment
106106
107107
108108def test_allocated_to_first_suitable_shipment_in_list ():
@@ -113,8 +113,8 @@ def test_allocated_to_first_suitable_shipment_in_list():
113113
114114 order .allocate (stock , shipments = [shipment1 , shipment2 ])
115115
116- assert order .allocations ['sku1' ] == shipment1
117- assert order .allocations ['sku2' ] == shipment1
116+ assert order .allocation ['sku1' ] == shipment1
117+ assert order .allocation ['sku2' ] == shipment1
118118
119119
120120def test_still_preserves_ordering_if_split_across_shipments ():
@@ -126,9 +126,9 @@ def test_still_preserves_ordering_if_split_across_shipments():
126126
127127 order .allocate (stock , shipments = [shipment1 , shipment2 , shipment3 ])
128128
129- assert order .allocations ['sku1' ] == shipment1
130- assert order .allocations ['sku2' ] == shipment2
131- assert order .allocations ['sku3' ] == shipment2
129+ assert order .allocation ['sku1' ] == shipment1
130+ assert order .allocation ['sku2' ] == shipment2
131+ assert order .allocation ['sku3' ] == shipment2
132132
133133
134134def test_stock_not_quite_enough_means_we_use_shipment ():
@@ -141,8 +141,8 @@ def test_stock_not_quite_enough_means_we_use_shipment():
141141
142142 order .allocate (stock , shipments = [shipment ])
143143
144- assert order .allocations ['sku1' ] == shipment
145- assert order .allocations ['sku2' ] == shipment
144+ assert order .allocation ['sku1' ] == shipment
145+ assert order .allocation ['sku2' ] == shipment
146146
147147
148148def test_cannot_allocate_if_insufficent_quantity_in_stock ():
@@ -151,7 +151,7 @@ def test_cannot_allocate_if_insufficent_quantity_in_stock():
151151
152152 order .allocate (stock , shipments = [])
153153
154- assert 'a-sku' not in order .allocations
154+ assert 'a-sku' not in order .allocation
155155
156156
157157def test_cannot_allocate_if_insufficent_quantity_in_shipment ():
@@ -162,5 +162,5 @@ def test_cannot_allocate_if_insufficent_quantity_in_shipment():
162162
163163 order .allocate (stock = Stock ({}), shipments = [shipment ])
164164
165- assert 'a-sku' not in order .allocations
165+ assert 'a-sku' not in order .allocation
166166
0 commit comments