-
-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #167 from EmbroidePy/silent-pass
Throw errors on file read/write if errors occur
- Loading branch information
Showing
4 changed files
with
44 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
|
||
setuptools.setup( | ||
name="pyembroidery", | ||
version="1.4.38", | ||
version="1.5.0", | ||
author="Tatarize", | ||
author_email="[email protected]", | ||
description="Embroidery IO library", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)) |