File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change 1
1
import base64
2
-
3
2
from os import path
3
+ from tempfile import NamedTemporaryFile
4
4
5
5
from nose .plugins .skip import SkipTest
6
6
7
7
from pydocx .tests import assert_html_equal , BASE_HTML
8
8
from pydocx .parsers .Docx2Html import Docx2Html
9
9
from pydocx .DocxParser import ZipFile
10
+ from pydocx .exceptions import MalformedDocxException
10
11
11
12
12
13
def convert (path , * args , ** kwargs ):
@@ -749,6 +750,15 @@ def test_missing_numbering():
749
750
''' )
750
751
751
752
753
+ def test_malformed_docx_exception ():
754
+ with NamedTemporaryFile (suffix = '.docx' ) as f :
755
+ try :
756
+ convert (f .name )
757
+ raise AssertionError ('MalformedDocxException was not raised' )
758
+ except MalformedDocxException :
759
+ pass
760
+
761
+
752
762
def _converter (* args , ** kwargs ):
753
763
# Having a converter that does nothing is the same as if abiword fails to
754
764
# convert.
You can’t perform that action at this time.
0 commit comments