Skip to content

Commit

Permalink
Merge pull request #602 from mscuthbert/patch-better-rst-test
Browse files Browse the repository at this point in the history
Patch better rst test
  • Loading branch information
mpacer committed Jun 26, 2017
2 parents 760cd49 + 8427eea commit eec0a5e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions nbconvert/exporters/tests/test_rst.py
Expand Up @@ -4,6 +4,7 @@
# Distributed under the terms of the Modified BSD License.

import io
import re

import nbformat
from nbformat import v4
Expand Down Expand Up @@ -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

0 comments on commit eec0a5e

Please sign in to comment.