Skip to content

Commit

Permalink
fix the tests that were returning a dict instead of a float
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanthecoder committed Aug 9, 2024
1 parent a162913 commit 75cd4d4
Showing 1 changed file with 4 additions and 19 deletions.
23 changes: 4 additions & 19 deletions api/tests/opentrons/hardware_control/test_ot3_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -815,15 +815,9 @@ async def test_liquid_probe(
with patch.object(
hardware_backend, "liquid_probe", AsyncMock(spec=hardware_backend.liquid_probe)
) as mock_liquid_probe:
return_dict = {
head_node: 140,
NodeId.gantry_x: 0,
NodeId.gantry_y: 0,
pipette_node: 0,
}

# make sure aspirate while sensing reverses direction
mock_liquid_probe.return_value = return_dict
mock_liquid_probe.return_value = 140
fake_settings_aspirate = LiquidProbeSettings(
mount_speed=5,
plunger_speed=20,
Expand All @@ -849,8 +843,7 @@ async def test_liquid_probe(
force_both_sensors=False,
)

return_dict[head_node], return_dict[pipette_node] = 142, 142
mock_liquid_probe.return_value = return_dict

await ot3_hardware.liquid_probe(
mount, fake_max_z_dist, fake_liquid_settings
) # should raise no exceptions
Expand Down Expand Up @@ -903,7 +896,7 @@ async def test_liquid_probe_plunger_moves(
PipetteLiquidNotFoundError,
PipetteLiquidNotFoundError,
PipetteLiquidNotFoundError,
None,
140,
]

fake_max_z_dist = 75.0
Expand Down Expand Up @@ -1056,16 +1049,10 @@ async def test_multi_liquid_probe(
with patch.object(
hardware_backend, "liquid_probe", AsyncMock(spec=hardware_backend.liquid_probe)
) as mock_liquid_probe:
return_dict = {
NodeId.head_l: 140,
NodeId.gantry_x: 0,
NodeId.gantry_y: 0,
NodeId.pipette_left: 0,
}
side_effects = [
PipetteLiquidNotFoundError(),
PipetteLiquidNotFoundError(),
return_dict,
140,
]

# make sure aspirate while sensing reverses direction
Expand Down Expand Up @@ -1103,8 +1090,6 @@ async def test_multi_liquid_probe(
)
assert mock_liquid_probe.call_count == 3

return_dict[NodeId.head_l], return_dict[NodeId.pipette_left] = 142, 142
mock_liquid_probe.return_value = return_dict


async def test_liquid_not_found(
Expand Down

0 comments on commit 75cd4d4

Please sign in to comment.