Skip to content

Commit

Permalink
test(shared-data): add pressFit pickUpTipConfigurations validation te…
Browse files Browse the repository at this point in the history
…st (#14587)
  • Loading branch information
sanni-t authored Mar 4, 2024
1 parent 050cf4d commit dd330c9
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions shared-data/python/tests/pipette/test_validate_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,36 @@ def test_check_all_models_are_valid() -> None:
)

assert isinstance(loaded_model, PipetteConfigurations)


def test_pick_up_configs_tip_count_keys() -> None:
"""Verify that speed, distance & current of pickUpTipConfigurations have same tip count keys."""
paths_to_validate = (
get_shared_data_root() / "pipette" / "definitions" / "2" / "general"
)
_channel_model_str = {
"single_channel": "single",
"ninety_six_channel": "96",
"eight_channel": "multi",
}
assert os.listdir(paths_to_validate), "You have a path wrong"
for channel_dir in os.listdir(paths_to_validate):
for model_dir in os.listdir(paths_to_validate / channel_dir):
for version_file in os.listdir(paths_to_validate / channel_dir / model_dir):
version_list = version_file.split(".json")[0].split("_")
built_model: PipetteModel = PipetteModel(
f"{model_dir}_{_channel_model_str[channel_dir]}_v{version_list[0]}.{version_list[1]}"
)

model_version = convert_pipette_model(built_model)
loaded_model = load_definition(
model_version.pipette_type,
model_version.pipette_channels,
model_version.pipette_version,
)
pick_up_tip_configs = loaded_model.pick_up_tip_configurations.press_fit
assert (
pick_up_tip_configs.distance_by_tip_count.keys()
== pick_up_tip_configs.speed_by_tip_count.keys()
== pick_up_tip_configs.current_by_tip_count.keys()
)

0 comments on commit dd330c9

Please sign in to comment.