From 93e945c2ca0b1118c8e119a09988d8b4093625d8 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Sat, 14 Dec 2013 16:48:59 +0000 Subject: Convert image using base64 encoding --- tests/conversion_tests.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'tests') diff --git a/tests/conversion_tests.py b/tests/conversion_tests.py index 7dc8b06..8935bb5 100644 --- a/tests/conversion_tests.py +++ b/tests/conversion_tests.py @@ -1,3 +1,5 @@ +import io + from nose.tools import istest, assert_equal from mammoth import documents, style_reader, results @@ -115,5 +117,12 @@ def docx_tab_is_converted_to_tab_in_html(): assert_equal('\t', result.value) +@istest +def images_are_converted_to_img_tags_with_data_uri(): + image = documents.image(alt_text=None, content_type="image/png", open=lambda: io.BytesIO("abc")) + result = convert_document_element_to_html(image) + assert_equal('', result.value) + + def _run_with_text(text): return documents.run(children=[documents.text(text)]) -- cgit v1.2.3