diff options
| author | Michael Williamson <mike@zwobble.org> | 2014-08-19 10:23:40 +0100 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2014-08-19 10:23:40 +0100 |
| commit | 28d664823a7a1fa58825e6488b9c88c2f6d3cb04 (patch) | |
| tree | 9fd65beab76e0162654f32c08dfad30247361a30 /tests | |
| parent | f3b1de5a7bed8272a22e4bc257ec6a61a4545b1d (diff) | |
Add test for files with UTF8 BOM
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/mammoth_tests.py | 8 | ||||
| -rw-r--r-- | tests/test-data/utf8-bom.docx | bin | 0 -> 2836 bytes |
2 files changed, 8 insertions, 0 deletions
diff --git a/tests/mammoth_tests.py b/tests/mammoth_tests.py index 9721d15..7ef8049 100644 --- a/tests/mammoth_tests.py +++ b/tests/mammoth_tests.py @@ -14,6 +14,14 @@ def docx_containing_one_paragraph_is_converted_to_single_p_element(): @istest +def can_read_xml_files_with_utf8_bom(): + with open(test_path("utf8-bom.docx"), "rb") as fileobj: + result = mammoth.convert_to_html(fileobj=fileobj) + assert_equal("<p>This XML has a byte order mark.</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/utf8-bom.docx b/tests/test-data/utf8-bom.docx Binary files differnew file mode 100644 index 0000000..3881238 --- /dev/null +++ b/tests/test-data/utf8-bom.docx |
