Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(shared-data): add pressFit pickUpTipConfigurations validation test #14587

Merged
merged 1 commit into from
Mar 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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()
)
Loading