From dd330c941df77e8c2b6c609f6135da8926a7732c Mon Sep 17 00:00:00 2001 From: Sanniti Pimpley Date: Mon, 4 Mar 2024 11:03:56 -0500 Subject: [PATCH] test(shared-data): add pressFit pickUpTipConfigurations validation test (#14587) --- .../tests/pipette/test_validate_schema.py | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/shared-data/python/tests/pipette/test_validate_schema.py b/shared-data/python/tests/pipette/test_validate_schema.py index df943dceace..a7f6c6d0e06 100644 --- a/shared-data/python/tests/pipette/test_validate_schema.py +++ b/shared-data/python/tests/pipette/test_validate_schema.py @@ -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() + )