diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/mammoth_tests.py | 16 | ||||
| -rw-r--r-- | tests/test-data/empty.docx | bin | 0 -> 3306 bytes |
2 files changed, 16 insertions, 0 deletions
diff --git a/tests/mammoth_tests.py b/tests/mammoth_tests.py index ce76221..d9f1093 100644 --- a/tests/mammoth_tests.py +++ b/tests/mammoth_tests.py @@ -26,6 +26,22 @@ def can_read_xml_files_with_utf8_bom(): @istest +def empty_paragraphs_are_ignored_by_default(): + with open(test_path("empty.docx"), "rb") as fileobj: + result = mammoth.convert_to_html(fileobj=fileobj) + assert_equal("", result.value) + assert_equal([], result.messages) + + +@istest +def empty_paragraphs_are_preserved_if_ignore_empty_paragraphs_is_false(): + with open(test_path("empty.docx"), "rb") as fileobj: + result = mammoth.convert_to_html(fileobj=fileobj, ignore_empty_paragraphs=False) + assert_equal("<p></p>", result.value) + assert_equal([], result.messages) + + +@istest def inline_images_are_included_in_output(): with open(test_path("tiny-picture.docx"), "rb") as fileobj: result = mammoth.convert_to_html(fileobj=fileobj) diff --git a/tests/test-data/empty.docx b/tests/test-data/empty.docx Binary files differnew file mode 100644 index 0000000..e10b869 --- /dev/null +++ b/tests/test-data/empty.docx |
