MCPcopy Create free account
hub / github.com/Kaggle/docker-python / TestJupyterNbconvert

Class TestJupyterNbconvert

tests/test_jupyter_nbconvert.py:5–36  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3import subprocess
4
5class TestJupyterNbconvert(unittest.TestCase):
6 def test_nbconvert_to_notebook(self):
7 result = subprocess.run([
8 'jupyter',
9 'nbconvert',
10 '--to',
11 'notebook',
12 '--template',
13 '/opt/kaggle/nbconvert-extensions.tpl',
14 '--execute',
15 '--stdout',
16 '/input/tests/data/notebook.ipynb',
17 ], stdout=subprocess.PIPE)
18
19 self.assertEqual(0, result.returncode)
20 self.assertTrue(b'999' in result.stdout)
21
22 def test_nbconvert_to_html(self):
23 result = subprocess.run([
24 'jupyter',
25 'nbconvert',
26 '--to',
27 'html',
28 '--template',
29 '/opt/kaggle/nbconvert-extensions.tpl',
30 '--execute',
31 '--stdout',
32 '/input/tests/data/notebook.ipynb',
33 ], stdout=subprocess.PIPE)
34
35 self.assertEqual(0, result.returncode)
36 self.assertTrue(b'999' in result.stdout)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected