Show More
@@ -12,6 +12,10 b'' | |||
|
12 | 12 | # Imports |
|
13 | 13 | #----------------------------------------------------------------------------- |
|
14 | 14 | |
|
15 | import io | |
|
16 | ||
|
17 | from IPython.nbformat import current | |
|
18 | ||
|
15 | 19 | from .base import ExportersTestsBase |
|
16 | 20 | from ..rst import RSTExporter |
|
17 | 21 | from IPython.testing.decorators import onlyif_cmds_exist |
@@ -40,3 +44,22 b' class TestRSTExporter(ExportersTestsBase):' | |||
|
40 | 44 | """ |
|
41 | 45 | (output, resources) = RSTExporter().from_filename(self._get_notebook()) |
|
42 | 46 | assert len(output) > 0 |
|
47 | ||
|
48 | @onlyif_cmds_exist('pandoc') | |
|
49 | def test_empty_code_cell(self): | |
|
50 | """No empty code cells in rst""" | |
|
51 | nbname = self._get_notebook() | |
|
52 | with io.open(nbname, encoding='utf8') as f: | |
|
53 | nb = current.read(f, 'json') | |
|
54 | ||
|
55 | exporter = self.exporter_class() | |
|
56 | ||
|
57 | (output, resources) = exporter.from_notebook_node(nb) | |
|
58 | # add an empty code cell | |
|
59 | nb.worksheets[0].cells.append( | |
|
60 | current.new_code_cell(input="") | |
|
61 | ) | |
|
62 | (output2, resources) = exporter.from_notebook_node(nb) | |
|
63 | # adding an empty code cell shouldn't change output | |
|
64 | self.assertEqual(output.strip(), output2.strip()) | |
|
65 |
General Comments 0
You need to be logged in to leave comments.
Login now