| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,29 @@ | |||
| 1 | + { | ||
| 2 | + "cells": [ | ||
| 3 | + { | ||
| 4 | + "metadata": { | ||
| 5 | + "trusted": true | ||
| 6 | + }, | ||
| 7 | + "cell_type": "code", | ||
| 8 | + "source": "x=999\nprint(x)", | ||
| 9 | + "execution_count": null, | ||
| 10 | + "outputs": [] | ||
| 11 | + } | ||
| 12 | + ], | ||
| 13 | + "metadata":{ | ||
| 14 | + "language_info":{ | ||
| 15 | + "codemirror_mode":{ | ||
| 16 | + "name":"ipython", | ||
| 17 | + "version":3 | ||
| 18 | + }, | ||
| 19 | + "file_extension":".py", | ||
| 20 | + "mimetype":"text/x-python", | ||
| 21 | + "name":"python", | ||
| 22 | + "nbconvert_exporter":"python", | ||
| 23 | + "pygments_lexer":"ipython3", | ||
| 24 | + "version":"3.7.6" | ||
| 25 | + } | ||
| 26 | + }, | ||
| 27 | + "nbformat":4, | ||
| 28 | + "nbformat_minor":4 | ||
| 29 | + } | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,20 @@ | |||
| 1 | + import unittest | ||
| 2 | + | ||
| 3 | + import subprocess | ||
| 4 | + | ||
| 5 | + class TestJupyterNbconvert(unittest.TestCase): | ||
| 6 | + def test_nbconvert(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) | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments