##// END OF EJS Templates
Merge pull request #8301 from minrk/rm-qtconsole...
Merge pull request #8301 from minrk/rm-qtconsole remove qtconsole

File last commit:

r21150:cc83a8d4
r21231:79730a28 merge
Show More
test_notebook.py
39 lines | 1.3 KiB | text/x-python | PythonLexer
Jonathan Frederic
Address final comments
r16847 """Tests for notebook.py"""
Julia Evans
Add IPython Notebook exporter
r16822
Julia Evans
Use new license
r16823 # Copyright (c) IPython Development Team.
Julia Evans
Add IPython Notebook exporter
r16822 # Distributed under the terms of the Modified BSD License.
MinRK
support downgrading notebooks with nbconvert...
r18247 import json
Julia Evans
Add IPython Notebook exporter
r16822 from .base import ExportersTestsBase
from ..notebook import NotebookExporter
MinRK
Don't use nbformat.current in nbconvert
r18605 from IPython.nbformat import validate
Min RK
move assert_big_text_equal to nbconvert...
r21150 from jupyter_nbconvert.tests.base import assert_big_text_equal
MinRK
add assert_big_text_equal...
r18248
Julia Evans
Add IPython Notebook exporter
r16822 class TestNotebookExporter(ExportersTestsBase):
"""Contains test functions for notebook.py"""
exporter_class = NotebookExporter
def test_export(self):
"""
Does the NotebookExporter return the file unchanged?
"""
with open(self._get_notebook()) as f:
file_contents = f.read()
MinRK
support downgrading notebooks with nbconvert...
r18247 (output, resources) = self.exporter_class().from_filename(self._get_notebook())
Julia Evans
Add IPython Notebook exporter
r16822 assert len(output) > 0
Min RK
regen nbconvert test file without split png data...
r20845 assert_big_text_equal(output.strip(), file_contents.strip())
MinRK
support downgrading notebooks with nbconvert...
r18247
def test_downgrade_3(self):
exporter = self.exporter_class(nbformat_version=3)
(output, resources) = exporter.from_filename(self._get_notebook())
nb = json.loads(output)
MinRK
remove heading cells in v4
r18596 validate(nb)
MinRK
support downgrading notebooks with nbconvert...
r18247
def test_downgrade_2(self):
exporter = self.exporter_class(nbformat_version=2)
(output, resources) = exporter.from_filename(self._get_notebook())
nb = json.loads(output)
self.assertEqual(nb['nbformat'], 2)