From 56f9935e507f2ae06e03fe1c131b84f937897395 2013-10-31 16:40:12 From: MinRK Date: 2013-10-31 16:40:12 Subject: [PATCH] test changes - add markdown code block to test notebook - update ansi filter test --- diff --git a/IPython/nbconvert/filters/tests/test_ansi.py b/IPython/nbconvert/filters/tests/test_ansi.py index e24c10c..05df5b2 100644 --- a/IPython/nbconvert/filters/tests/test_ansi.py +++ b/IPython/nbconvert/filters/tests/test_ansi.py @@ -68,12 +68,12 @@ class TestAnsi(TestsBase): def test_ansi2latex(self): """ansi2latex test""" correct_outputs = { - '%s' % (TermColors.Red) : r'\red{}', - 'hello%s' % TermColors.Blue: r'hello\blue{}', - 'he%s%sllo' % (TermColors.Green, TermColors.Cyan) : r'he\green{}\cyan{llo}', - '%shello' % TermColors.Yellow : r'\yellow{hello}', - '{0}h{0}e{0}l{0}l{0}o{0}'.format(TermColors.White) : r'\white{h}\white{e}\white{l}\white{l}\white{o}\white{}', - 'hel%slo' % TermColors.Green : r'hel\green{lo}', + '%s' % (TermColors.Red) : r'{\color{red}}', + 'hello%s' % TermColors.Blue: r'hello{\color{blue}}', + 'he%s%sllo' % (TermColors.Green, TermColors.Cyan) : r'he{\color{green}}{\color{cyan}llo}', + '%shello' % TermColors.Yellow : r'{\color{yellow}hello}', + '{0}h{0}e{0}l{0}l{0}o{0}'.format(TermColors.White) : r'{\color{white}h}{\color{white}e}{\color{white}l}{\color{white}l}{\color{white}o}{\color{white}}', + 'hel%slo' % TermColors.Green : r'hel{\color{green}lo}', 'hello' : 'hello'} for inval, outval in correct_outputs.items(): diff --git a/IPython/nbconvert/tests/files/notebook2.ipynb b/IPython/nbconvert/tests/files/notebook2.ipynb index 807a2a2..1cc6ae9 100644 --- a/IPython/nbconvert/tests/files/notebook2.ipynb +++ b/IPython/nbconvert/tests/files/notebook2.ipynb @@ -1,6 +1,6 @@ { "metadata": { - "name": "notebook2" + "name": "" }, "nbformat": 3, "nbformat_minor": 0, @@ -171,12 +171,15 @@ "prompt_number": 14 }, { - "cell_type": "code", - "collapsed": false, - "input": [], - "language": "python", + "cell_type": "markdown", "metadata": {}, - "outputs": [] + "source": [ + "```python\n", + "def foo(bar=1):\n", + " \"\"\"docstring\"\"\"\n", + " raise Exception(\"message\")\n", + "```" + ] } ], "metadata": {}