File size: 329 Bytes
051db69
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
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")