def METHOD_NAME(file_cache):
    """Test writing a read-only cached file."""
    filename = "read-only-file.txt"
    path = file_cache.cache_path(filename)
    fs.touch(path)
    os.chmod(path, 0o400)
    with pytest.raises(CacheError, match="Insufficient permissions to write"):
        file_cache.write_transaction(filename)