Download .venv/lib/python3.12/site-packages/fsspec/tests/abstract/open.py from FaustDerLegende/split: direct link, hf CLI and curl.
- Browser
- Download file 329 Bytes
-
https://huggingface.co/datasets/FaustDerLegende/split/resolve/main/.venv/lib/python3.12/site-packages/fsspec/tests/abstract/open.py
- Command line
-
hf download hf://datasets/FaustDerLegende/split/.venv/lib/python3.12/site-packages/fsspec/tests/abstract/open.py
-
curl -L -o open.py https://huggingface.co/datasets/FaustDerLegende/split/resolve/main/.venv/lib/python3.12/site-packages/fsspec/tests/abstract/open.py
329 Bytes
| import pytest | |
| class AbstractOpenTests: | |
| def test_open_exclusive(self, fs, fs_target): | |
| with fs.open(fs_target, "wb") as f: | |
| f.write(b"data") | |
| with fs.open(fs_target, "rb") as f: | |
| assert f.read() == b"data" | |
| with pytest.raises(FileExistsError): | |
| fs.open(fs_target, "xb") | |