def METHOD_NAME(
    tmp_path: Path,
    config: Config,
    tc1_meta: dict[str, str],
    tc2_meta: dict[str, str],
    tc3_meta: dict[str, str],
    err: Optional[str],
):
    c1 = setup_mock_component(tmp_path, name="tc1")
    c2 = setup_mock_component(tmp_path, name="tc2")
    c3 = setup_mock_component(tmp_path, name="tc3")
    config.inventory.ensure_dirs()
    config.register_component(c1)
    config.register_component(c2)
    config.register_component(c3)
    cluster_params = {
        c1.parameters_key: {
            "_metadata": tc1_meta,
        },
        c2.parameters_key: {
            "_metadata": tc2_meta,
        },
        c3.parameters_key: {
            "_metadata": tc3_meta,
        },
        "components": {
            "tc1": {
                "url": "https://example.com/tc1.git",
                "version": "master",
            },
            "tc2": {
                "url": "https://example.com/tc2.git",
                "version": "master",
            },
            "tc3": {
                "url": "https://example.com/tc3.git",
                "version": "master",
            },
        },
    }
    if err:
        with pytest.raises(click.ClickException) as e:
            component_library.create_component_library_aliases(config, cluster_params)
        assert err in str(e.value)
    else:
        component_library.create_component_library_aliases(config, cluster_params)