diff --git a/api/tests/opentrons/protocol_engine/conftest.py b/api/tests/opentrons/protocol_engine/conftest.py index 8574cefe248..d4b6ccbff61 100644 --- a/api/tests/opentrons/protocol_engine/conftest.py +++ b/api/tests/opentrons/protocol_engine/conftest.py @@ -20,6 +20,7 @@ from opentrons.hardware_control import HardwareControlAPI, OT2HardwareControlAPI from opentrons.hardware_control.api import API +from opentrons_shared_data.robot.dev_types import RobotTypeEnum if TYPE_CHECKING: from opentrons.hardware_control.ot3api import OT3API @@ -44,7 +45,9 @@ def ot3_hardware_api(decoy: Decoy) -> OT3API: try: from opentrons.hardware_control.ot3api import OT3API - return decoy.mock(cls=OT3API) + mock = decoy.mock(cls=OT3API) + decoy.when(mock.get_robot_type()).then_return(RobotTypeEnum.FLEX) + return mock except ImportError: # TODO (tz, 9-23-22) Figure out a better way to use this fixture with OT-3 api only. return None # type: ignore[return-value] diff --git a/api/tests/opentrons/protocol_engine/execution/test_labware_movement_handler.py b/api/tests/opentrons/protocol_engine/execution/test_labware_movement_handler.py index 838039488f0..65f639acb18 100644 --- a/api/tests/opentrons/protocol_engine/execution/test_labware_movement_handler.py +++ b/api/tests/opentrons/protocol_engine/execution/test_labware_movement_handler.py @@ -171,9 +171,7 @@ async def test_move_labware_with_gripper( decoy.when(state_store.config.use_virtual_gripper).then_return(False) decoy.when(ot3_hardware_api.has_gripper()).then_return(True) - decoy.when(ot3_hardware_api._gripper_handler.is_ready_for_jaw_home()).then_return( - True - ) + decoy.when(ot3_hardware_api.gripper_jaw_can_home()).then_return(True) decoy.when( await ot3_hardware_api.gantry_position(mount=OT3Mount.GRIPPER) diff --git a/api/tests/opentrons/protocol_engine/resources/test_ot3_validation.py b/api/tests/opentrons/protocol_engine/resources/test_ot3_validation.py index d2382bf70a1..0c575f96c25 100644 --- a/api/tests/opentrons/protocol_engine/resources/test_ot3_validation.py +++ b/api/tests/opentrons/protocol_engine/resources/test_ot3_validation.py @@ -6,6 +6,7 @@ from opentrons.protocol_engine.errors.exceptions import HardwareNotSupportedError from opentrons.hardware_control.api import API +from opentrons_shared_data.robot.dev_types import RobotTypeEnum @pytest.mark.ot3_only @@ -16,6 +17,7 @@ def test_ensure_ot3_hardware(decoy: Decoy) -> None: from opentrons.hardware_control.ot3api import OT3API ot_3_hardware_api = decoy.mock(cls=OT3API) + decoy.when(ot_3_hardware_api.get_robot_type()).then_return(RobotTypeEnum.FLEX) result = ensure_ot3_hardware( ot_3_hardware_api, ) @@ -28,6 +30,7 @@ def test_ensure_ot3_hardware(decoy: Decoy) -> None: def test_ensure_ot3_hardware_raises_error(decoy: Decoy) -> None: """Should raise a HardwareNotSupportedError exception.""" ot_2_hardware_api = decoy.mock(cls=API) + decoy.when(ot_2_hardware_api.get_robot_type()).then_return(RobotTypeEnum.OT2) with pytest.raises(HardwareNotSupportedError): ensure_ot3_hardware( ot_2_hardware_api,