def test_inference_options_index_config(): cfg = _test_config assert (config.index_config( cfg, "bpreprocess/classifiers/1") == cfg["bpreprocess"]["classifiers"][1]) with pytest.raises(ValueError, match="Invalid path"): config.index_config(cfg, "bpreprocess/annotate") assert (config.index_config( cfg, "bpreprocess/classifiers/1/value", index_structure=False) == (cfg["bpreprocess"]["classifiers"][1], "value")) with pytest.raises(ValueError, match="Invalid path"): config.index_config(cfg, "bpreprocess/classifiers/1/value")
def test_inference_options_index_config_v2(): cfg = _test_config_v2 assert config.index_config( cfg, "preprocess/my-domain-op") == cfg["preprocess"][0]