From 4621bbd8d0ee425263dc0706031b5f96af4822a2 Mon Sep 17 00:00:00 2001 From: M Pacer Date: Thu, 1 Jun 2017 15:25:20 -0700 Subject: [PATCH] test for the width and height attributes inside the image in the output --- nbconvert/exporters/tests/test_html.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/nbconvert/exporters/tests/test_html.py b/nbconvert/exporters/tests/test_html.py index 19fd468e8..b75e62942 100644 --- a/nbconvert/exporters/tests/test_html.py +++ b/nbconvert/exporters/tests/test_html.py @@ -66,7 +66,11 @@ def test_png_metadata(self): """ (output, resources) = HTMLExporter(template_file='basic').from_filename( self._get_notebook(nb_name="pngmetadata.ipynb")) - assert len(output) > 0 + check_for_png = re.compile(r']*?)>') + result = check_for_png.search(output) + attr_string = result.group(1) + assert 'width' in attr_string + assert 'height' in attr_string def test_javascript_output(self): nb = v4.new_notebook(