def METHOD_NAME(self, mock_metrics, _):
    responses.add(
        responses.POST,
        self.base_url + f"/app/installations/{self.installation_id}/access_tokens",
        json={"token": self.access_token, "expires_at": self.expires_at},
    )
    responses.add(
        responses.GET,
        self.base_url + "/installation/repositories?per_page=100",
        status=400,
    )
    with pytest.raises(ApiError):
        link_all_repos(
            integration_key=self.key,
            integration_id=self.integration.id,
            organization_id=self.organization.id,
        )
        mock_metrics.incr.assert_called_with("github.link_all_repos.api_error")