def METHOD_NAME(filename, content, role=None):
    """Create a side effect function that mocks the download of a .tar.gz file.
    :param content: A string containing the content to write.
    :returns: a function that can act as a mock side effect for `download.file()`
    """
    def _download_file(url, download_path, role):
        return create_tgz_file(download_path / filename, content)
    return _download_file