Skip to content

Commit

Permalink
Add tests for IOError raising
Browse files Browse the repository at this point in the history
  • Loading branch information
tatarize committed Nov 6, 2023
1 parent f368d17 commit 4683183
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions test/test_io.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import unittest

from test.pattern_for_tests import *


class TestExplicitIOErrors(unittest.TestCase):
def test_read_non_file(self):
"""
1.5.0 adds explicit error raising.
We test that now.
"""
file1 = "nosuchfile.dst"
self.assertRaises(IOError, lambda: EmbPattern(file1))

def test_write_non_supported(self):
"""
1.5.0 adds explicit error raising.
We test that now.
"""
pattern = get_simple_pattern()
file1 = "nosuchfile.pdf"
self.assertRaises(IOError, lambda: pattern.write(file1))

def test_write_no_writer(self):
"""
1.5.0 adds explicit error raising.
We test that now.
"""
pattern = get_simple_pattern()
file1 = "nosuchfile.dat"
self.assertRaises(IOError, lambda: pattern.write(file1))

0 comments on commit 4683183

Please sign in to comment.