File tree Expand file tree Collapse file tree 2 files changed +19
-8
lines changed
src/opentrons/protocol_engine/commands/flex_stacker
tests/opentrons/protocol_engine/commands/flex_stacker Expand file tree Collapse file tree 2 files changed +19
-8
lines changed Original file line number Diff line number Diff line change @@ -177,7 +177,14 @@ async def execute(self, params: StoreParams) -> _ExecuteReturn:
177
177
stacker_state = self ._state_view .modules .get_flex_stacker_substate (
178
178
params .moduleId
179
179
)
180
+
180
181
location = self ._state_view .modules .get_location (params .moduleId )
182
+ pool_definitions = stacker_state .get_pool_definition_ordered_list ()
183
+ if pool_definitions is None :
184
+ raise FlexStackerLabwarePoolNotYetDefinedError (
185
+ message = f"The Flex Stacker in { location } has not been configured yet and cannot be filled."
186
+ )
187
+
181
188
if (
182
189
len (stacker_state .contained_labware_bottom_first )
183
190
== stacker_state .max_pool_count
@@ -186,12 +193,6 @@ async def execute(self, params: StoreParams) -> _ExecuteReturn:
186
193
f"Cannot store labware in Flex Stacker in { location } because it is full"
187
194
)
188
195
189
- pool_definitions = stacker_state .get_pool_definition_ordered_list ()
190
- if pool_definitions is None :
191
- raise FlexStackerLabwarePoolNotYetDefinedError (
192
- message = f"The Flex Stacker in { location } has not been configured yet and cannot be filled."
193
- )
194
-
195
196
primary_id , maybe_adapter_id , maybe_lid_id = self ._verify_labware_to_store (
196
197
params , stacker_state
197
198
)
Original file line number Diff line number Diff line change @@ -137,7 +137,17 @@ async def test_store_raises_if_carriage_logically_empty(
137
137
await subject .execute (data )
138
138
139
139
140
+ @pytest .mark .parametrize (
141
+ "contained_labware_count,max_pool_count" ,
142
+ [
143
+ (0 , 0 ),
144
+ (1 , 0 ),
145
+ (0 , 1 ),
146
+ ],
147
+ )
140
148
async def test_store_raises_if_not_configured (
149
+ contained_labware_count : int ,
150
+ max_pool_count : int ,
141
151
decoy : Decoy ,
142
152
equipment : EquipmentHandler ,
143
153
state_view : StateView ,
@@ -151,8 +161,8 @@ async def test_store_raises_if_not_configured(
151
161
pool_primary_definition = None ,
152
162
pool_adapter_definition = None ,
153
163
pool_lid_definition = None ,
154
- contained_labware_bottom_first = _contained_labware (1 ),
155
- max_pool_count = 0 ,
164
+ contained_labware_bottom_first = _contained_labware (contained_labware_count ),
165
+ max_pool_count = max_pool_count ,
156
166
pool_overlap = 0 ,
157
167
)
158
168
decoy .when (
You can’t perform that action at this time.
0 commit comments