async def METHOD_NAME(
    hacs: HacsBase,
    repository_full_name: str,
    expected_message: str,
    aresponses: ResponsesMockServer,
) -> None:
    """Test repository registration."""
    repo_data = {**repository_data, "full_name": repository_full_name}
    aresponses.add(
        "api.github.com",
        f"/repos/{repository_full_name}",
        "get",
        aresponses.Response(body=json.dumps(repo_data), headers=response_rate_limit_header),
    )
    aresponses.add(
        "api.github.com",
        f"/repos/{repository_full_name}/releases",
        "get",
        aresponses.Response(body=json.dumps([]), headers=response_rate_limit_header),
    )
    aresponses.add(
        "api.github.com",
        f"/repos/{repository_full_name}/git/trees/main",
        "get",
        aresponses.Response(
            body=json.dumps(
                {
                    "tree": {
                        "home-assistant/core": [],
                        "home-assistant/addons": [
                            {"path": "repository.json", "type": "blob"},
                        ],
                        "hassio-addons/some-addon": [
                            {"path": "repository.json", "type": "blob"},
                        ],
                        "some-user/addons": [
                            {"path": "repository.yaml", "type": "blob"},
                        ],
                        "some-user/some-invalid-repo": [
                            {"path": "setup.py", "type": "blob"},
                        ],
                    }[repository_full_name]
                }
            ),
            headers=response_rate_limit_header,
        ),
    )
    assert hacs.repositories.get_by_full_name(repository_full_name) is None
    with pytest.raises(HacsException, match=expected_message):
        await hacs.async_register_repository(
            repository_full_name, HacsCategory.INTEGRATION, check=True
        )