Skip to content

Commit

Permalink
rest of mock fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
caila-marashaj committed Jan 14, 2025
1 parent bea6ff0 commit 7623191
Show file tree
Hide file tree
Showing 10 changed files with 34 additions and 2 deletions.
9 changes: 9 additions & 0 deletions api/tests/opentrons/protocol_engine/commands/test_aspirate.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ async def test_aspirate_implementation_no_prep(
minimum_z_height=None,
speed=None,
operation_volume=-50,
is_tracking=False,
),
).then_return(Point(x=1, y=2, z=3))

Expand Down Expand Up @@ -209,6 +210,7 @@ async def test_aspirate_implementation_with_prep(
minimum_z_height=None,
speed=None,
operation_volume=None,
is_tracking=False,
),
).then_return(Point())

Expand All @@ -227,6 +229,7 @@ async def test_aspirate_implementation_with_prep(
minimum_z_height=None,
speed=None,
operation_volume=-volume,
is_tracking=False,
),
).then_return(Point(x=1, y=2, z=3))

Expand Down Expand Up @@ -317,6 +320,7 @@ async def test_aspirate_raises_volume_error(
minimum_z_height=None,
speed=None,
operation_volume=-50,
is_tracking=False,
),
).then_return(Point(1, 2, 3))

Expand Down Expand Up @@ -393,6 +397,7 @@ async def test_overpressure_error(
minimum_z_height=None,
speed=None,
operation_volume=-50,
is_tracking=False,
),
).then_return(position)

Expand Down Expand Up @@ -493,6 +498,7 @@ async def test_aspirate_implementation_meniscus(
minimum_z_height=None,
speed=None,
operation_volume=-50,
is_tracking=False,
),
).then_return(Point(x=1, y=2, z=3))

Expand Down Expand Up @@ -572,6 +578,7 @@ async def test_stall_during_final_movement(
minimum_z_height=None,
speed=None,
operation_volume=-50,
is_tracking=False,
),
).then_raise(StallOrCollisionDetectedError())

Expand Down Expand Up @@ -632,6 +639,7 @@ async def test_stall_during_preparation(
minimum_z_height=None,
speed=None,
operation_volume=None,
is_tracking=False,
),
).then_raise(StallOrCollisionDetectedError())
decoy.when(model_utils.generate_id()).then_return(error_id)
Expand Down Expand Up @@ -704,6 +712,7 @@ async def test_overpressure_during_preparation(
minimum_z_height=None,
speed=None,
operation_volume=None,
is_tracking=False,
),
).then_return(prep_location)

Expand Down
3 changes: 3 additions & 0 deletions api/tests/opentrons/protocol_engine/commands/test_blow_out.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ async def test_blow_out_implementation(
minimum_z_height=None,
speed=None,
operation_volume=None,
is_tracking=False,
)
).then_return(Point(x=1, y=2, z=3))

Expand Down Expand Up @@ -152,6 +153,7 @@ async def test_overpressure_error(
minimum_z_height=None,
speed=None,
operation_volume=None,
is_tracking=False,
)
).then_return(Point(x=1, y=2, z=3))

Expand Down Expand Up @@ -227,6 +229,7 @@ async def test_stall_error(
minimum_z_height=None,
speed=None,
operation_volume=None,
is_tracking=False,
)
).then_raise(StallOrCollisionDetectedError())

Expand Down
3 changes: 3 additions & 0 deletions api/tests/opentrons/protocol_engine/commands/test_dispense.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ async def test_dispense_implementation(
minimum_z_height=None,
speed=None,
operation_volume=None,
is_tracking=False,
)
).then_return(Point(x=1, y=2, z=3))

Expand Down Expand Up @@ -188,6 +189,7 @@ async def test_overpressure_error(
minimum_z_height=None,
speed=None,
operation_volume=None,
is_tracking=False,
),
).then_return(position)

Expand Down Expand Up @@ -279,6 +281,7 @@ async def test_stall_error(
minimum_z_height=None,
speed=None,
operation_volume=None,
is_tracking=False,
),
).then_raise(StallOrCollisionDetectedError())

Expand Down
4 changes: 4 additions & 0 deletions api/tests/opentrons/protocol_engine/commands/test_drop_tip.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ async def test_drop_tip_implementation(
minimum_z_height=None,
speed=None,
operation_volume=None,
is_tracking=False,
)
).then_return(Point(x=111, y=222, z=333))

Expand Down Expand Up @@ -218,6 +219,7 @@ async def test_drop_tip_with_alternating_locations(
minimum_z_height=None,
speed=None,
operation_volume=None,
is_tracking=False,
)
).then_return(Point(x=111, y=222, z=333))

Expand Down Expand Up @@ -289,6 +291,7 @@ async def test_tip_attached_error(
minimum_z_height=None,
speed=None,
operation_volume=None,
is_tracking=False,
)
).then_return(Point(x=111, y=222, z=333))
decoy.when(
Expand Down Expand Up @@ -385,6 +388,7 @@ async def test_stall_error(
minimum_z_height=None,
speed=None,
operation_volume=None,
is_tracking=False,
)
).then_raise(StallOrCollisionDetectedError())

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ async def test_liquid_probe_implementation(
minimum_z_height=None,
speed=None,
operation_volume=None,
is_tracking=False,
),
).then_return(Point(x=1, y=2, z=3))

Expand Down Expand Up @@ -315,6 +316,7 @@ async def test_liquid_not_found_error(
minimum_z_height=None,
speed=None,
operation_volume=None,
is_tracking=False,
),
).then_return(position)

Expand Down Expand Up @@ -715,6 +717,7 @@ async def test_liquid_probe_stall(
minimum_z_height=None,
speed=None,
operation_volume=None,
is_tracking=False,
),
).then_raise(StallOrCollisionDetectedError())

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ async def test_move_to_well_implementation(
speed=7.89,
current_well=None,
operation_volume=None,
is_tracking=False,
)
).then_return(Point(x=9, y=8, z=7))

Expand Down Expand Up @@ -136,6 +137,7 @@ async def test_move_to_well_stall_defined_error(
speed=7.89,
current_well=None,
operation_volume=None,
is_tracking=False,
)
).then_raise(StallOrCollisionDetectedError())
decoy.when(mock_model_utils.generate_id()).then_return(error_id)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ async def test_success(
minimum_z_height=None,
speed=None,
operation_volume=None,
is_tracking=False,
)
).then_return(Point(x=111, y=222, z=333))

Expand Down Expand Up @@ -152,6 +153,7 @@ async def test_tip_physically_missing_error(
minimum_z_height=None,
speed=None,
operation_volume=None,
is_tracking=False,
)
).then_return(Point(x=111, y=222, z=333))
decoy.when(
Expand Down Expand Up @@ -244,6 +246,7 @@ async def test_stall_error(
minimum_z_height=None,
speed=None,
operation_volume=None,
is_tracking=False,
)
).then_raise(StallOrCollisionDetectedError())

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ async def test_touch_tip_implementation(
minimum_z_height=None,
speed=None,
operation_volume=None,
is_tracking=False,
)
).then_return(Point(x=1, y=2, z=3))

Expand Down Expand Up @@ -178,6 +179,7 @@ async def test_touch_tip_implementation_with_mm_to_edge(
minimum_z_height=None,
speed=None,
operation_volume=None,
is_tracking=False,
)
).then_return(Point(x=1, y=2, z=3))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ async def test_move_to_well(
force_direct=True,
minimum_z_height=12.3,
operation_volume=None,
is_tracking=False,
)
).then_return(
[Waypoint(Point(1, 2, 3), CriticalPoint.XY_CENTER), Waypoint(Point(4, 5, 6))]
Expand Down Expand Up @@ -259,6 +260,7 @@ async def test_move_to_well_from_starting_location(
force_direct=False,
minimum_z_height=None,
operation_volume=None,
is_tracking=False,
)
).then_return([Waypoint(Point(1, 2, 3), CriticalPoint.XY_CENTER)])

Expand Down
5 changes: 3 additions & 2 deletions api/tests/opentrons/protocol_engine/state/test_motion_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ def test_get_movement_waypoints_to_well_for_y_center(

decoy.when(
geometry_view.get_well_position(
"labware-id", "well-name", WellLocation(), None, "pipette-id"
"labware-id", "well-name", WellLocation(), None, "pipette-id", False
)
).then_return(Point(x=4, y=5, z=6))

Expand Down Expand Up @@ -394,7 +394,7 @@ def test_get_movement_waypoints_to_well_for_xy_center(

decoy.when(
geometry_view.get_well_position(
"labware-id", "well-name", WellLocation(), None, "pipette-id"
"labware-id", "well-name", WellLocation(), None, "pipette-id", False
)
).then_return(Point(x=4, y=5, z=6))

Expand Down Expand Up @@ -466,6 +466,7 @@ def test_get_movement_waypoints_to_well_raises(
well_location=None,
operation_volume=None,
pipette_id="pipette-id",
is_tracking=False,
)
).then_return(Point(x=4, y=5, z=6))
decoy.when(pipette_view.get_current_location()).then_return(None)
Expand Down

0 comments on commit 7623191

Please sign in to comment.