Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanthecoder committed Jul 22, 2024
1 parent 103cf2c commit 6b2f1c8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
1 change: 0 additions & 1 deletion api/src/opentrons/hardware_control/ot3api.py
Original file line number Diff line number Diff line change
Expand Up @@ -2670,7 +2670,6 @@ async def liquid_probe(
instrument.plunger_positions.bottom - instrument.plunger_positions.top
)

max_speeds = self.config.motion_settings.default_max_speed
# We need to significatly slow down the 96 channel liquid probe
if self.gantry_load == GantryLoad.HIGH_THROUGHPUT:
max_plunger_speed = self.config.motion_settings.max_speed_discontinuity[
Expand Down
19 changes: 11 additions & 8 deletions api/tests/opentrons/hardware_control/test_ot3_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ def fake_settings() -> CapacitivePassSettings:
@pytest.fixture
def fake_liquid_settings() -> LiquidProbeSettings:
return LiquidProbeSettings(
mount_speed=40,
plunger_speed=10,
mount_speed=5,
plunger_speed=20,
plunger_impulse_time=0.2,
sensor_threshold_pascals=15,
output_option=OutputOptions.can_bus_only,
Expand Down Expand Up @@ -825,8 +825,8 @@ async def test_liquid_probe(
# make sure aspirate while sensing reverses direction
mock_liquid_probe.return_value = return_dict
fake_settings_aspirate = LiquidProbeSettings(
mount_speed=40,
plunger_speed=10,
mount_speed=5,
plunger_speed=20,
plunger_impulse_time=0.2,
sensor_threshold_pascals=15,
output_option=OutputOptions.can_bus_only,
Expand All @@ -838,10 +838,11 @@ async def test_liquid_probe(
mock_move_to_plunger_bottom.call_count == 2
mock_liquid_probe.assert_called_once_with(
mount,
3.0,
52,
fake_settings_aspirate.mount_speed,
(fake_settings_aspirate.plunger_speed * -1),
fake_settings_aspirate.sensor_threshold_pascals,
fake_settings_aspirate.plunger_impulse_time,
fake_settings_aspirate.output_option,
fake_settings_aspirate.data_files,
probe=InstrumentProbeType.PRIMARY,
Expand Down Expand Up @@ -913,10 +914,11 @@ async def test_multi_liquid_probe(
assert mock_move_to_plunger_bottom.call_count == 4
mock_liquid_probe.assert_called_with(
OT3Mount.LEFT,
plunger_positions.bottom - plunger_positions.top,
plunger_positions.bottom - plunger_positions.top - 0.1,
fake_settings_aspirate.mount_speed,
(fake_settings_aspirate.plunger_speed * -1),
fake_settings_aspirate.sensor_threshold_pascals,
fake_settings_aspirate.plunger_impulse_time,
fake_settings_aspirate.output_option,
fake_settings_aspirate.data_files,
probe=InstrumentProbeType.PRIMARY,
Expand Down Expand Up @@ -954,6 +956,7 @@ async def _fake_pos_update_and_raise(
mount_speed: float,
plunger_speed: float,
threshold_pascals: float,
plunger_impulse_time: float,
output_format: OutputOptions = OutputOptions.can_bus_only,
data_files: Optional[Dict[InstrumentProbeType, str]] = None,
probe: InstrumentProbeType = InstrumentProbeType.PRIMARY,
Expand Down Expand Up @@ -986,8 +989,8 @@ async def _fake_pos_update_and_raise(
await ot3_hardware.liquid_probe(
OT3Mount.LEFT, fake_max_z_dist, fake_settings_aspirate
)
# assert that it went through 3 passes and then prepared to aspirate
assert mock_move_to_plunger_bottom.call_count == 4
# assert that it went through 4 passes and then prepared to aspirate
assert mock_move_to_plunger_bottom.call_count == 5


@pytest.mark.parametrize(
Expand Down

0 comments on commit 6b2f1c8

Please sign in to comment.