##// END OF EJS Templates
fix test for pandoc 1.9.3
Matthias BUSSONNIER -
Show More
@@ -1,39 +1,43 b''
1 import os
1 import os
2 import io
2 import io
3 import nose.tools as nt
3 import nose.tools as nt
4 from nbconvert import *
4 from nbconvert import *
5 from nose.tools import nottest
5 from nose.tools import nottest
6
6
7
7
8 def test_evens():
8 def test_evens():
9 ######
9 ######
10 # for now, we don't need to really run inkscape to extract svg
10 # for now, we don't need to really run inkscape to extract svg
11 # from file, on unix, for test, we monkeypathc it to 'true'
11 # from file, on unix, for test, we monkeypathc it to 'true'
12 # which does not fail as doing anything.
12 # which does not fail as doing anything.
13 ####
13 ####
14 ConverterLaTeX.inkscape = 'true'
14 ConverterLaTeX.inkscape = 'true'
15
15
16 converters = [(ConverterRST,'rst'),
16 converters = [(ConverterRST,'rst'),
17 (ConverterMarkdown,'md'),
17 (ConverterMarkdown,'md'),
18 (ConverterLaTeX,'tex'),
18 (ConverterLaTeX,'tex'),
19 (ConverterPy,'py'),
19 (ConverterPy,'py'),
20 (ConverterHTML,'html')
20 (ConverterHTML,'html')
21 ]
21 ]
22 reflist = [
22 reflist = [
23 'tests/ipynbref/IntroNumPy.orig'
23 'tests/ipynbref/IntroNumPy.orig'
24 ]
24 ]
25 for root in reflist :
25 for root in reflist :
26 for conv,ext in converters:
26 for conv,ext in converters:
27 yield test_conversion, conv,root+'.ipynb',root+'.'+ext
27 yield test_conversion, conv,root+'.ipynb',root+'.'+ext
28
28
29 @nottest
29 @nottest
30 def compfiles(stra, strb):
31 nt.assert_equal(map(unicode.strip,stra.split('\n')),map(unicode.strip,strb.split('\n')))
32
33 @nottest
30 def test_conversion(ConverterClass, ipynb, ref_file):
34 def test_conversion(ConverterClass, ipynb, ref_file):
31
35
32 converter = ConverterClass(ipynb)
36 converter = ConverterClass(ipynb)
33 converter.read()
37 converter.read()
34 cv =converter.convert()
38 cv =converter.convert()
35 with io.open(ref_file) as ref:
39 with io.open(ref_file) as ref:
36 value = ref.read()
40 value = ref.read()
37 nt.assert_equal(cv.split('\n'),value.split('\n'))
41 compfiles(cv,value)
38
42
39
43
General Comments 0
You need to be logged in to leave comments. Login now