ai-station/.venv/lib/python3.12/site-packages/fsspec/tests/abstract/pipe.py

12 lines
402 B
Python
Raw Normal View History

2025-12-25 14:54:33 +00:00
import pytest
class AbstractPipeTests:
def test_pipe_exclusive(self, fs, fs_target):
fs.pipe_file(fs_target, b"data")
assert fs.cat_file(fs_target) == b"data"
with pytest.raises(FileExistsError):
fs.pipe_file(fs_target, b"data", mode="create")
fs.pipe_file(fs_target, b"new data", mode="overwrite")
assert fs.cat_file(fs_target) == b"new data"