def METHOD_NAME(
    mock_get_url, original, component_name, tmp_path, found_url
):
    if found_url:
        mock_get_url.return_value = found_url
    else:
        mock_get_url.return_value = None
    req_file = tmp_path / "req.txt"
    req_file.write_text(original)
    repo_name = "raw-1"
    username = "my_username"
    password = "my_password"
    if not found_url and component_name:
        msg = f"Could not retrieve URL for {component_name} in {repo_name}. Was the asset uploaded?"
        with pytest.raises(NexusError, match=msg):
            pip._get_custom_requirement_config_file(
                req_file, tmp_path, repo_name, username, password
            )
    elif found_url and "://" not in found_url and component_name:
        msg = f"Nexus raw resource URL: {found_url} is not a valid URL"
        with pytest.raises(NexusError, match=msg):
            pip._get_custom_requirement_config_file(
                req_file, tmp_path, repo_name, username, password
            )
    else:
        req = pip._get_custom_requirement_config_file(
            req_file, tmp_path, repo_name, username, password
        )
        if component_name:
            mock_get_url.assert_called_once_with(
                repo_name, component_name, max_attempts=5, from_nexus_hoster=False
            )
            assert req["type"] == "base64"
            assert req["path"] == "app/req.txt"
            final_url = found_url.replace("://", f"://{username}:{password}@")
            assert final_url in base64.b64decode(req["content"]).decode()
        else:
            mock_get_url.assert_not_called()
            assert req is None