##// END OF EJS Templates
Much cleaner way of picking the right converter (inspired by a suggestion by Carreau).
Much cleaner way of picking the right converter (inspired by a suggestion by Carreau).

File last commit:

r8687:82011338
r8728:652928ef
Show More
test_references.py
46 lines | 1.2 KiB | text/x-python | PythonLexer
/ tests / test_references.py
Matthias BUSSONNIER
Systematic test of ipynb -> * conversion...
r8649 import os
import io
import nose.tools as nt
from nbconvert import *
from nose.tools import nottest
def test_evens():
######
# for now, we don't need to really run inkscape to extract svg
# from file, on unix, for test, we monkeypathc it to 'true'
# which does not fail as doing anything.
####
ConverterLaTeX.inkscape = 'true'
Matthias BUSSONNIER
comment ipynb->rst test to avoid travis failing
r8687 # commenting rst for now as travis build
# fail because of pandoc version.
converters = [
#(ConverterRST,'rst'),
Matthias BUSSONNIER
Systematic test of ipynb -> * conversion...
r8649 (ConverterMarkdown,'md'),
(ConverterLaTeX,'tex'),
(ConverterPy,'py'),
(ConverterHTML,'html')
]
reflist = [
'tests/ipynbref/IntroNumPy.orig'
]
for root in reflist :
for conv,ext in converters:
yield test_conversion, conv,root+'.ipynb',root+'.'+ext
@nottest
Matthias BUSSONNIER
fix test for pandoc 1.9.3
r8657 def compfiles(stra, strb):
nt.assert_equal(map(unicode.strip,stra.split('\n')),map(unicode.strip,strb.split('\n')))
@nottest
Matthias BUSSONNIER
Systematic test of ipynb -> * conversion...
r8649 def test_conversion(ConverterClass, ipynb, ref_file):
converter = ConverterClass(ipynb)
converter.read()
cv =converter.convert()
with io.open(ref_file) as ref:
value = ref.read()
Matthias BUSSONNIER
fix test for pandoc 1.9.3
r8657 compfiles(cv,value)
Matthias BUSSONNIER
Systematic test of ipynb -> * conversion...
r8649