import tempfile


def mock_file(content):
    """Generate a file like object containing the given content."""
    temp = tempfile.TemporaryFile(mode='r+')
    temp.write(content)
    temp.seek(0)
    return temp