Skip to content

Commit

Permalink
tests: Add test for invalid opening-modes
Browse files Browse the repository at this point in the history
... for MemoryView. Increases code coverage.

Related to #19
  • Loading branch information
Makman2 committed Jan 20, 2018
1 parent 8d842c8 commit ed1b75f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/test_MemoryView.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,13 @@ def test_double_close(read_test_process):
assert str(ex.value) == expected_message


def test_invalid_mode(read_test_process):
with pytest.raises(ValueError) as ex:
MemoryView(read_test_process.pid, 'rwx')

assert str(ex.value) == 'Invalid access mode: rwx'


def test_read_int(read_test_process):
field = next(v for v in read_test_process.values
if v.type == 'int')
Expand Down

0 comments on commit ed1b75f

Please sign in to comment.