Skip to content

Commit

Permalink
Test nonreadable
Browse files Browse the repository at this point in the history
  • Loading branch information
Donaim committed Aug 7, 2024
1 parent 44f29f8 commit 545acb3
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion tests/test_subtextio.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import pytest
import os
from multicsv.subtextio import SubTextIO
from multicsv.exceptions import OpOnClosedError, InvalidWhenceError, InvalidSubtextCoordinates, EndsBeyondBaseContent, BaseMustBeSeekable
from multicsv.exceptions import OpOnClosedError, InvalidWhenceError, InvalidSubtextCoordinates, EndsBeyondBaseContent, BaseMustBeSeekable, BaseMustBeReadable


@pytest.fixture
Expand Down Expand Up @@ -447,3 +447,10 @@ def seekable(self):

with pytest.raises(BaseMustBeSeekable):
SubTextIO(file, start=0, end=0)

def test_not_readable():
import tempfile

with tempfile.NamedTemporaryFile(mode="w") as file:
with pytest.raises(BaseMustBeReadable):
SubTextIO(file, start=0, end=10)

0 comments on commit 545acb3

Please sign in to comment.