diff --git a/nbconvert/exporters/tests/test_rst.py b/nbconvert/exporters/tests/test_rst.py index ab0390337..6119bfa85 100644 --- a/nbconvert/exporters/tests/test_rst.py +++ b/nbconvert/exporters/tests/test_rst.py @@ -4,6 +4,7 @@ # Distributed under the terms of the Modified BSD License. import io +import re import nbformat from nbformat import v4 @@ -61,3 +62,12 @@ def test_png_metadata(self): (output, resources) = RSTExporter().from_filename( self._get_notebook(nb_name="pngmetadata.ipynb")) assert len(output) > 0 + check_for_png = re.compile( + r'.. image::.*?\n\s+(.*?)\n\s*\n', + re.DOTALL) + result = check_for_png.search(output) + assert result is not None + attr_string = result.group(1) + assert ':width:' in attr_string + assert ':height:' in attr_string + assert 'px' in attr_string