def METHOD_NAME(fs: fsspec.AbstractFileSystem):
    with TemporaryDirectory() as tmpdir:
        writer = TransactionalFile(tmpdir, fs)
        # Ensure we can lock on a directory
        writer.acquire_lock()
        # Ensure we cannot write to a directory scoped lock
        with pytest.raises(RuntimeError):
            writer.write(b"test 1")
        writer.release_lock()