Show More
@@ -1,10 +1,10 b'' | |||||
1 | from nbconvert import ConverterNotebook |
|
1 | from nbconvert import ConverterNotebook | |
2 | import nose.tools as nt |
|
2 | import nose.tools as nt | |
3 | import os |
|
3 | import os, json | |
4 |
|
4 | |||
5 | fname = 'tests/test.ipynb' |
|
5 | fname = 'tests/test.ipynb' | |
6 | outbase1 = 'newtest1' |
|
6 | outbase1 = 'newtest1' | |
7 | outbase2 = 'newtest2' |
|
7 | outbase2 = 'test' # will output to ./test.ipynb | |
8 |
|
8 | |||
9 | def test_roundtrip(): |
|
9 | def test_roundtrip(): | |
10 | converter = ConverterNotebook(fname, outbase1) |
|
10 | converter = ConverterNotebook(fname, outbase1) | |
@@ -18,3 +18,7 b' def test_roundtrip():' | |||||
18 | nt.assert_true(s1.replace(outbase1, outbase2) == s2) |
|
18 | nt.assert_true(s1.replace(outbase1, outbase2) == s2) | |
19 | os.remove(outbase1+'.ipynb') |
|
19 | os.remove(outbase1+'.ipynb') | |
20 | os.remove(outbase2+'.ipynb') |
|
20 | os.remove(outbase2+'.ipynb') | |
|
21 | ||||
|
22 | s0 = json.dumps(json.load(file(fname)), indent=1, sort_keys=True) | |||
|
23 | nt.assert_true(s0 == s2) | |||
|
24 |
General Comments 0
You need to be logged in to leave comments.
Login now