##// END OF EJS Templates
try to shutdown at the end of every notebook run...
try to shutdown at the end of every notebook run this line causes noise in the test suite, but if we just ignore it, we'll never get to the bottom of it. It seems to only happen when running 'iptest js', and *not* when running the 'casperjs test' command directly, with a notebookserver that was launched manually.

File last commit:

r7874:4a6836ce
r13288:f4ebc6b7
Show More
test_nbbase.py
41 lines | 1.1 KiB | text/x-python | PythonLexer
Brian E. Granger
Full versioning added to nbformat.
r4406 from unittest import TestCase
from ..nbbase import (
NotebookNode,
new_code_cell, new_text_cell, new_notebook
)
class TestCell(TestCase):
def test_empty_code_cell(self):
cc = new_code_cell()
Bradley M. Froehle
s/assertEquals/assertEqual/
r7874 self.assertEqual(cc.cell_type,'code')
self.assertEqual('code' not in cc, True)
self.assertEqual('prompt_number' not in cc, True)
Brian E. Granger
Full versioning added to nbformat.
r4406
def test_code_cell(self):
cc = new_code_cell(code='a=10', prompt_number=0)
Bradley M. Froehle
s/assertEquals/assertEqual/
r7874 self.assertEqual(cc.code, u'a=10')
self.assertEqual(cc.prompt_number, 0)
Brian E. Granger
Full versioning added to nbformat.
r4406
def test_empty_text_cell(self):
tc = new_text_cell()
Bradley M. Froehle
s/assertEquals/assertEqual/
r7874 self.assertEqual(tc.cell_type, 'text')
self.assertEqual('text' not in tc, True)
Brian E. Granger
Full versioning added to nbformat.
r4406
def test_text_cell(self):
tc = new_text_cell('hi')
Bradley M. Froehle
s/assertEquals/assertEqual/
r7874 self.assertEqual(tc.text, u'hi')
Brian E. Granger
Full versioning added to nbformat.
r4406
class TestNotebook(TestCase):
def test_empty_notebook(self):
nb = new_notebook()
Bradley M. Froehle
s/assertEquals/assertEqual/
r7874 self.assertEqual(nb.cells, [])
Brian E. Granger
Full versioning added to nbformat.
r4406
def test_notebooke(self):
cells = [new_code_cell(),new_text_cell()]
nb = new_notebook(cells=cells)
Bradley M. Froehle
s/assertEquals/assertEqual/
r7874 self.assertEqual(nb.cells,cells)
Brian E. Granger
Full versioning added to nbformat.
r4406