aboutsummaryrefslogtreecommitdiff
path: root/tests/mammoth_tests.py
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2017-01-23 20:17:18 +0000
committerMichael Williamson <mike@zwobble.org>2017-01-23 20:17:34 +0000
commitde55a714711a27207367bc8c5c8370549a9bd219 (patch)
tree61765502ea99e740c2a6d1f7ab1391794e5f0e9d /tests/mammoth_tests.py
parentcd52af70959fa7a549f2283a36408e5144c19112 (diff)
Handle target URIs relative to the base
Diffstat (limited to 'tests/mammoth_tests.py')
-rw-r--r--tests/mammoth_tests.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/tests/mammoth_tests.py b/tests/mammoth_tests.py
index 322ebf7..8789855 100644
--- a/tests/mammoth_tests.py
+++ b/tests/mammoth_tests.py
@@ -108,7 +108,7 @@ p => h1"""
@istest
-def inline_images_are_included_in_output():
+def inline_images_referenced_by_path_relative_to_part_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,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAIAAAACUFjqAAAAAXNSR0IArs4c6QAAAAlwSFlzAAAOvgAADr4B6kKxwAAAABNJREFUKFNj/M+ADzDhlWUYqdIAQSwBE8U+X40AAAAASUVORK5CYII=" /></p>""", result.value)
@@ -116,6 +116,14 @@ def inline_images_are_included_in_output():
@istest
+def inline_images_referenced_by_path_relative_to_base_are_included_in_output():
+ with open(test_path("tiny-picture-target-base-relative.docx"), "rb") as fileobj:
+ result = mammoth.convert_to_html(fileobj=fileobj)
+ assert_equal("""<p><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAIAAAACUFjqAAAAAXNSR0IArs4c6QAAAAlwSFlzAAAOvgAADr4B6kKxwAAAABNJREFUKFNj/M+ADzDhlWUYqdIAQSwBE8U+X40AAAAASUVORK5CYII=" /></p>""", result.value)
+ assert_equal([], result.messages)
+
+
+@istest
def images_stored_outside_of_document_are_included_in_output():
with open(test_path("external-picture.docx"), "rb") as fileobj:
result = mammoth.convert_to_html(fileobj=fileobj)