File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed
Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change 1+ import unittest
2+
3+ from test .pattern_for_tests import *
4+
5+
6+ class TestExplicitIOErrors (unittest .TestCase ):
7+ def test_read_non_file (self ):
8+ """
9+ 1.5.0 adds explicit error raising.
10+ We test that now.
11+ """
12+ file1 = "nosuchfile.dst"
13+ self .assertRaises (IOError , lambda : EmbPattern (file1 ))
14+
15+ def test_write_non_supported (self ):
16+ """
17+ 1.5.0 adds explicit error raising.
18+ We test that now.
19+ """
20+ pattern = get_simple_pattern ()
21+ file1 = "nosuchfile.pdf"
22+ self .assertRaises (IOError , lambda : pattern .write (file1 ))
23+
24+ def test_write_no_writer (self ):
25+ """
26+ 1.5.0 adds explicit error raising.
27+ We test that now.
28+ """
29+ pattern = get_simple_pattern ()
30+ file1 = "nosuchfile.dat"
31+ self .assertRaises (IOError , lambda : pattern .write (file1 ))
You can’t perform that action at this time.
0 commit comments