| 3 | import subprocess |
| 4 | |
| 5 | class 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) |
nothing calls this directly
no outgoing calls
no test coverage detected