aboutsummaryrefslogtreecommitdiff
path: root/.venv/lib/python3.12/site-packages/fsspec/tests/abstract/open.py
blob: bb75ea852276fb8d834345883813b8e27a0ae24c (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
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")