aboutsummaryrefslogtreecommitdiff
path: root/tests/mammoth_tests.py
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2013-12-14 17:33:13 +0000
committerMichael Williamson <mike@zwobble.org>2013-12-14 17:33:13 +0000
commit85cc3f93c01312a907fd017d34bc2e5542cac670 (patch)
tree6319244994842c813c73005de7cb971fbfe99061 /tests/mammoth_tests.py
parentf5595b78f59d3f3a04c4e83702114dc2704f808a (diff)
Plumbing to get full stack working
Diffstat (limited to 'tests/mammoth_tests.py')
-rw-r--r--tests/mammoth_tests.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/mammoth_tests.py b/tests/mammoth_tests.py
index d1492b3..bfa88b5 100644
--- a/tests/mammoth_tests.py
+++ b/tests/mammoth_tests.py
@@ -11,3 +11,20 @@ def docx_containing_one_paragraph_is_converted_to_single_p_element():
result = mammoth.convert_to_html(fileobj=fileobj)
assert_equal("<p>Walking on imported air</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)
+ assert_equal("""<p><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAIAAAACUFjqAAAAAXNSR0IArs4c6QAAAAlwSFlzAAAO\nvgAADr4B6kKxwAAAABNJREFUKFNj/M+ADzDhlWUYqdIAQSwBE8U+X40AAAAASUVORK5CYII=" /></p>""", result.value)
+ assert_equal([], result.messages)
+
+
+@istest
+def simple_list_is_converted_to_list_elements():
+ with open(test_path("simple-list.docx"), "rb") as fileobj:
+ result = mammoth.convert_to_html(fileobj=fileobj)
+ assert_equal([], result.messages)
+ assert_equal("<ul><li>Apple</li><li>Banana</li></ul>", result.value)
+