24
24
from opentrons .protocol_engine .resources import ModelUtils
25
25
from opentrons .protocol_engine .state import update_types
26
26
from opentrons .protocol_engine .state .state import StateView
27
- from opentrons .protocol_engine .types import TipGeometry
27
+ from opentrons .protocol_engine .types import TipGeometry , FluidKind , AspiratedFluid
28
28
29
29
from opentrons .protocol_engine .commands .movement_common import StallOrCollisionError
30
30
from opentrons .protocol_engine .commands .command import DefinedErrorData , SuccessData
@@ -100,6 +100,10 @@ async def test_success(
100
100
operation_volume = None ,
101
101
)
102
102
).then_return (Point (x = 111 , y = 222 , z = 333 ))
103
+ decoy .when (
104
+ state_view .geometry .get_nominal_tip_geometry ("pipette-id" , "labware-id" , "A3" )
105
+ ).then_return (TipGeometry (length = 42 , diameter = 5 , volume = 300 ))
106
+ decoy .when (state_view .pipettes .get_maximum_volume ("pipette-id" )).then_return (1000 )
103
107
104
108
decoy .when (
105
109
await tip_handler .pick_up_tip (
@@ -126,20 +130,13 @@ async def test_success(
126
130
position = DeckPoint (x = 111 , y = 222 , z = 333 ),
127
131
),
128
132
state_update = update_types .StateUpdate (
129
- pipette_location = update_types .PipetteLocationUpdate (
130
- pipette_id = "pipette-id" ,
131
- new_location = update_types .Well (labware_id = "labware-id" , well_name = "A3" ),
132
- new_deck_point = DeckPoint (x = 111 , y = 222 , z = 333 ),
133
- ),
134
133
pipette_tip_state = update_types .PipetteTipStateUpdate (
135
134
pipette_id = "pipette-id" ,
136
135
tip_geometry = TipGeometry (length = 42 , diameter = 5 , volume = 300 ),
137
136
),
138
- tips_used = update_types .TipsUsedUpdate (
139
- pipette_id = "pipette-id" , labware_id = "labware-id" , well_name = "A3"
140
- ),
141
- pipette_aspirated_fluid = update_types .PipetteEmptyFluidUpdate (
142
- pipette_id = "pipette-id"
137
+ pipette_aspirated_fluid = update_types .PipetteAspiratedFluidUpdate (
138
+ pipette_id = "pipette-id" ,
139
+ fluid = AspiratedFluid (kind = FluidKind .LIQUID , volume = 1000 ),
143
140
),
144
141
),
145
142
)
@@ -192,63 +189,43 @@ async def test_no_tip_physically_missing_error(
192
189
operation_volume = None ,
193
190
)
194
191
).then_return (Point (x = 111 , y = 222 , z = 333 ))
192
+ decoy .when (
193
+ state_view .geometry .get_nominal_tip_geometry (pipette_id , labware_id , well_name )
194
+ ).then_return (TipGeometry (length = 42 , diameter = 5 , volume = 300 ))
195
+
195
196
decoy .when (
196
197
await tip_handler .pick_up_tip (
197
198
pipette_id = pipette_id , labware_id = labware_id , well_name = well_name
198
199
)
199
- ).then_raise (
200
- PickUpTipTipNotAttachedError (
201
- tip_geometry = TipGeometry (length = 42 , diameter = 5 , volume = 300 )
202
- )
203
- )
200
+ ).then_raise (PickUpTipTipNotAttachedError (tip_geometry = sentinel .tip_geometry ))
204
201
decoy .when (model_utils .generate_id ()).then_return (error_id )
205
202
decoy .when (model_utils .get_timestamp ()).then_return (error_created_at )
206
203
decoy .when (state_view .labware .get_definition (labware_id )).then_return (
207
204
evotips_definition
208
205
)
206
+ decoy .when (state_view .pipettes .get_maximum_volume (pipette_id )).then_return (1000 )
209
207
210
208
result = await subject .execute (
211
209
EvotipSealPipetteParams (
212
210
pipetteId = pipette_id , labwareId = labware_id , wellName = well_name
213
211
)
214
212
)
215
213
216
- assert result == DefinedErrorData (
217
- public = StallOrCollisionError .model_construct (
218
- id = error_id , createdAt = error_created_at , wrappedErrors = [matchers .Anything ()]
214
+ assert result == SuccessData (
215
+ public = EvotipSealPipetteResult (
216
+ tipLength = 42 ,
217
+ tipVolume = 300 ,
218
+ tipDiameter = 5 ,
219
+ position = DeckPoint (x = 111 , y = 222 , z = 333 ),
219
220
),
220
221
state_update = update_types .StateUpdate (
221
- pipette_location = update_types .PipetteLocationUpdate (
222
- pipette_id = "pipette-id" ,
223
- new_location = update_types .Well (
224
- labware_id = "labware-id" , well_name = "well-name"
225
- ),
226
- new_deck_point = DeckPoint (x = 111 , y = 222 , z = 333 ),
227
- ),
228
- tips_used = update_types .TipsUsedUpdate (
229
- pipette_id = "pipette-id" , labware_id = "labware-id" , well_name = "well-name"
230
- ),
231
- pipette_aspirated_fluid = update_types .PipetteUnknownFluidUpdate (
232
- pipette_id = "pipette-id"
233
- ),
234
- ),
235
- state_update_if_false_positive = update_types .StateUpdate (
236
222
pipette_tip_state = update_types .PipetteTipStateUpdate (
237
223
pipette_id = "pipette-id" ,
238
224
tip_geometry = TipGeometry (length = 42 , diameter = 5 , volume = 300 ),
239
225
),
240
- pipette_aspirated_fluid = update_types .PipetteEmptyFluidUpdate (
241
- pipette_id = "pipette-id"
242
- ),
243
- tips_used = update_types .TipsUsedUpdate (
244
- pipette_id = "pipette-id" , labware_id = "labware-id" , well_name = "well-name"
245
- ),
246
- pipette_location = update_types .PipetteLocationUpdate (
226
+ pipette_aspirated_fluid = update_types .PipetteAspiratedFluidUpdate (
247
227
pipette_id = "pipette-id" ,
248
- new_location = update_types .Well (
249
- labware_id = "labware-id" , well_name = "well-name"
250
- ),
251
- new_deck_point = DeckPoint (x = 111 , y = 222 , z = 333 ),
228
+ fluid = AspiratedFluid (kind = FluidKind .LIQUID , volume = 1000 ),
252
229
),
253
230
),
254
231
)
0 commit comments