##// END OF EJS Templates
testing roundtrip of test.ipynb file after passing through json.dump/json.load
Jonathan Taylor -
Show More
@@ -1,10 +1,10 b''
1 1 from nbconvert import ConverterNotebook
2 2 import nose.tools as nt
3 import os
3 import os, json
4 4
5 5 fname = 'tests/test.ipynb'
6 6 outbase1 = 'newtest1'
7 outbase2 = 'newtest2'
7 outbase2 = 'test' # will output to ./test.ipynb
8 8
9 9 def test_roundtrip():
10 10 converter = ConverterNotebook(fname, outbase1)
@@ -18,3 +18,7 b' def test_roundtrip():'
18 18 nt.assert_true(s1.replace(outbase1, outbase2) == s2)
19 19 os.remove(outbase1+'.ipynb')
20 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