From 6b2f1c825fd78bcb1cb019d77d8085ae2dc27709 Mon Sep 17 00:00:00 2001 From: Ryan howard Date: Mon, 22 Jul 2024 15:44:07 -0400 Subject: [PATCH] fix tests --- api/src/opentrons/hardware_control/ot3api.py | 1 - .../hardware_control/test_ot3_api.py | 19 +++++++++++-------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/api/src/opentrons/hardware_control/ot3api.py b/api/src/opentrons/hardware_control/ot3api.py index bb73ffc7ec8..eeec4711580 100644 --- a/api/src/opentrons/hardware_control/ot3api.py +++ b/api/src/opentrons/hardware_control/ot3api.py @@ -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[ diff --git a/api/tests/opentrons/hardware_control/test_ot3_api.py b/api/tests/opentrons/hardware_control/test_ot3_api.py index 2b77ebdcd00..0c1fff849c0 100644 --- a/api/tests/opentrons/hardware_control/test_ot3_api.py +++ b/api/tests/opentrons/hardware_control/test_ot3_api.py @@ -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, @@ -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, @@ -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, @@ -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, @@ -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, @@ -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(