-
Notifications
You must be signed in to change notification settings - Fork 178
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
created two needed tests for my PR and updated frustum_helper.py
- Loading branch information
1 parent
a5f4f04
commit 250af76
Showing
3 changed files
with
90 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
api/tests/opentrons/protocol_engine/state/test_frustum_helpers.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
"""Test methods that translate well heights and volumes for GeometryView.""" | ||
from opentrons.protocol_engine.state.frustum_helpers import ( | ||
find_volume_at_well_height, | ||
find_height_at_well_volume, | ||
) | ||
from ...protocol_runner.test_json_translator import _load_labware_definition_data | ||
|
||
|
||
def test_find_volume_at_well_height() -> None: | ||
"""Test find_volume_at_well_height.""" | ||
labware_def = _load_labware_definition_data() | ||
assert labware_def.innerLabwareGeometry is not None | ||
inner_well_def = labware_def.innerLabwareGeometry["welldefinition1111"] | ||
result = find_volume_at_well_height(40.0, inner_well_def) | ||
assert result == 1245.833 # use isclose() or something | ||
|
||
|
||
def test_find_height_at_well_volume() -> None: | ||
"""Test find_height_at_well_volume.""" | ||
labware_def = _load_labware_definition_data() | ||
assert labware_def.innerLabwareGeometry is not None | ||
inner_well_def = labware_def.innerLabwareGeometry["welldefinition1111"] | ||
result = find_height_at_well_volume(1245.833, inner_well_def) | ||
assert result == 40.0 # use isclose() or something |