##// END OF EJS Templates
Add regression tests for html nbconvert
Jessica B. Hamrick -
Show More
@@ -169,6 +169,15 b''
169 169 "language": "python",
170 170 "metadata": {},
171 171 "outputs": []
172 },
173 {
174 "cell_type": "code",
175 "collapsed": false,
176 "input": [],
177 "language": "python",
178 "metadata": {},
179 "outputs": [],
180 "prompt_number": null
172 181 }
173 182 ],
174 183 "metadata": {}
@@ -15,6 +15,7 b''
15 15 from .base import ExportersTestsBase
16 16 from ..html import HTMLExporter
17 17 from IPython.testing.decorators import onlyif_any_cmd_exists
18 import re
18 19
19 20 #-----------------------------------------------------------------------------
20 21 # Class
@@ -59,3 +60,17 b' class TestHTMLExporter(ExportersTestsBase):'
59 60 (output, resources) = HTMLExporter(template_file='full').from_filename(self._get_notebook())
60 61 assert len(output) > 0
61 62
63 @onlyif_any_cmd_exists('nodejs', 'node', 'pandoc')
64 def test_prompt_number(self):
65 """
66 Does HTMLExporter properly format input and output prompts?
67 """
68 (output, resources) = HTMLExporter(template_file='full').from_filename(self._get_notebook())
69 in_regex = r"In \[(.*)\]:"
70 out_regex = r"Out\[(.*)\]:"
71
72 ins = ["1", "2", "6", "7", "8", "10", "14", " ", " "]
73 outs = ["7", "10", "14"]
74
75 assert re.findall(in_regex, output) == ins
76 assert re.findall(out_regex, output) == outs
General Comments 0
You need to be logged in to leave comments. Login now