Skip to content

Commit

Permalink
Merge pull request #601 from mpacer/better_png_test
Browse files Browse the repository at this point in the history
test for the width and height attributes inside the image in the output
  • Loading branch information
Carreau authored Jun 2, 2017
2 parents 21bf6c4 + 4621bbd commit 2fa33b9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion nbconvert/exporters/tests/test_html.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'<img src="[^"]*?"([^>]*?)>')
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(
Expand Down

0 comments on commit 2fa33b9

Please sign in to comment.