Uploaded Test files
This commit is contained in:
parent
f584ad9d97
commit
2e81cb7d99
16627 changed files with 2065359 additions and 102444 deletions
41
venv/Lib/site-packages/nbformat/v1/tests/test_nbbase.py
Normal file
41
venv/Lib/site-packages/nbformat/v1/tests/test_nbbase.py
Normal file
|
@ -0,0 +1,41 @@
|
|||
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()
|
||||
self.assertEqual(cc.cell_type,'code')
|
||||
self.assertEqual('code' not in cc, True)
|
||||
self.assertEqual('prompt_number' not in cc, True)
|
||||
|
||||
def test_code_cell(self):
|
||||
cc = new_code_cell(code='a=10', prompt_number=0)
|
||||
self.assertEqual(cc.code, u'a=10')
|
||||
self.assertEqual(cc.prompt_number, 0)
|
||||
|
||||
def test_empty_text_cell(self):
|
||||
tc = new_text_cell()
|
||||
self.assertEqual(tc.cell_type, 'text')
|
||||
self.assertEqual('text' not in tc, True)
|
||||
|
||||
def test_text_cell(self):
|
||||
tc = new_text_cell('hi')
|
||||
self.assertEqual(tc.text, u'hi')
|
||||
|
||||
|
||||
class TestNotebook(TestCase):
|
||||
|
||||
def test_empty_notebook(self):
|
||||
nb = new_notebook()
|
||||
self.assertEqual(nb.cells, [])
|
||||
|
||||
def test_notebooke(self):
|
||||
cells = [new_code_cell(),new_text_cell()]
|
||||
nb = new_notebook(cells=cells)
|
||||
self.assertEqual(nb.cells,cells)
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue