aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2021-11-01 19:34:28 +0000
committerMichael Williamson <mike@zwobble.org>2021-11-01 19:34:28 +0000
commitba91bed42994af2425540a60b1797d93347e8900 (patch)
treed6b919dd972de7f7a2561419572d37ddcd8b0c14 /tests
parent6dee8fcbc822e4fcad128add2637c5955c694a7f (diff)
Handle a:blip elements without image file
Diffstat (limited to 'tests')
-rw-r--r--tests/docx/body_xml_tests.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/docx/body_xml_tests.py b/tests/docx/body_xml_tests.py
index 1ce2e95..e0328fb 100644
--- a/tests/docx/body_xml_tests.py
+++ b/tests/docx/body_xml_tests.py
@@ -1153,6 +1153,17 @@ class ImageTests(object):
with image.open() as image_file:
assert_equal(self.IMAGE_BYTES, image_file.read())
+ @istest
+ def warning_if_blip_has_no_image_file(self):
+ drawing = _create_inline_image(
+ blip=xml_element("a:blip"),
+ description="It's a hat",
+ )
+
+ result = _read_document_xml_element(drawing)
+
+ assert_equal([results.warning("Could not find image file for a:blip element")], result.messages)
+ assert_equal(None, result.value)
@istest
@funk.with_mocks