Skip to content

Commit

Permalink
added test
Browse files Browse the repository at this point in the history
  • Loading branch information
sanni-t committed Dec 18, 2023
1 parent 099c431 commit 89034c9
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions api/tests/opentrons/protocol_api/test_instrument_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -600,6 +600,7 @@ def test_pick_up_from_associated_tip_racks(
mock_well = decoy.mock(cls=Well)
top_location = Location(point=Point(1, 2, 3), labware=mock_well)

decoy.when(mock_instrument_core.is_tip_tracking_available()).then_return(True)
decoy.when(mock_instrument_core.get_active_channels()).then_return(123)
decoy.when(
labware.next_available_tip(
Expand All @@ -626,6 +627,22 @@ def test_pick_up_from_associated_tip_racks(
)


def test_pick_up_fails_when_tip_tracking_unavailable(
decoy: Decoy, mock_instrument_core: InstrumentCore, subject: InstrumentContext
) -> None:
"""It should raise an error if automatic tip tracking is not available.."""
mock_tip_rack_1 = decoy.mock(cls=Labware)

decoy.when(mock_instrument_core.is_tip_tracking_available()).then_return(False)
decoy.when(mock_instrument_core.get_active_channels()).then_return(123)

subject.tip_racks = [mock_tip_rack_1]
with pytest.raises(
CommandPreconditionViolated, match="Automatic tip tracking is not available"
):
subject.pick_up_tip()


def test_drop_tip_to_well(
decoy: Decoy, mock_instrument_core: InstrumentCore, subject: InstrumentContext
) -> None:
Expand Down

0 comments on commit 89034c9

Please sign in to comment.