Skip to content

Commit

Permalink
added tests
Browse files Browse the repository at this point in the history
  • Loading branch information
TamarZanzouri committed Oct 1, 2024
1 parent 09703e8 commit 62e1a88
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from __future__ import annotations
from pydantic import BaseModel
from typing import TYPE_CHECKING, Optional, Type
from typing import Optional, Type
from typing_extensions import Literal

from ..command import AbstractCommandImpl, BaseCommand, BaseCommandCreate, SuccessData
Expand All @@ -11,9 +11,6 @@

from opentrons.hardware_control import HardwareControlAPI

if TYPE_CHECKING:
from ...execution import GantryMover


UnsafeUngripLabwareCommandType = Literal["unsafe/ungripLabware"]

Expand All @@ -37,11 +34,9 @@ class UnsafeUngripLabwareImplementation(
def __init__(
self,
hardware_api: HardwareControlAPI,
gantry_mover: GantryMover,
**kwargs: object,
) -> None:
self._hardware_api = hardware_api
self._gantry_mover = gantry_mover

async def execute(
self, params: UnsafeUngripLabwareParams
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
"""Test update-position-estimator commands."""
from decoy import Decoy

from opentrons.protocol_engine.commands.unsafe.unsafe_ungrip_labware import (
UnsafeUngripLabwareParams,
UnsafeUngripLabwareResult,
UnsafeUngripLabwareImplementation,
)
from opentrons.protocol_engine.commands.command import SuccessData
from opentrons.protocol_engine.execution import GantryMover
from opentrons.protocol_engine.types import MotorAxis
from opentrons.hardware_control import OT3HardwareControlAPI
from opentrons.hardware_control.types import Axis


async def test_engage_axes_implementation(
decoy: Decoy, ot3_hardware_api: OT3HardwareControlAPI, gantry_mover: GantryMover
) -> None:
"""Test EngageAxes command execution."""
subject = UnsafeUngripLabwareImplementation(hardware_api=ot3_hardware_api)

result = await subject.execute(params=UnsafeUngripLabwareParams())

assert result == SuccessData(public=UnsafeUngripLabwareResult(), private=None)

decoy.verify(
await ot3_hardware_api.ungrip(),
)

0 comments on commit 62e1a88

Please sign in to comment.