Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
GiovanniCiampi committed Sep 17, 2021
1 parent c79c6a5 commit fc8e2c7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
5 changes: 3 additions & 2 deletions papermill/tests/notebooks/simple_execute.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"metadata": {},
"outputs": [],
"source": [
"#papermill_description=DESC\n",
"print(msg)"
]
},
Expand Down Expand Up @@ -46,9 +47,9 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.7"
"version": "3.8.5"
}
},
"nbformat": 4,
"nbformat_minor": 1
"nbformat_minor": 4
}
9 changes: 7 additions & 2 deletions papermill/tests/test_engines.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,15 @@ def test_save_new_nb(self):
nb_man = NotebookExecutionManager(self.nb)
nb_man.save(nb=self.foo_nb)
self.assertEqual(nb_man.nb.metadata['foo'], 'bar')


def test_get_cell_description(self):
nb_man = NotebookExecutionManager(self.nb)
self.assertIsNone(nb_man.get_cell_description(nb_man.nb.cells[0]))
self.assertEqual(nb_man.get_cell_description(nb_man.nb.cells[1]), 'DESC')

def test_notebook_start(self):
nb_man = NotebookExecutionManager(self.nb)
nb_man.save = Mock()
nb_man.nb_path.metadata['foo'] = 'bar'
nb_man.notebook_start()

self.assertEqual(nb_man.nb.metadata.papermill['start_time'], nb_man.start_time.isoformat())
Expand Down

0 comments on commit fc8e2c7

Please sign in to comment.