##// END OF EJS Templates
Use default OS shell to run system commands...
Use default OS shell to run system commands Instead of using os.system which uses /bin/sh, this uses subprocess.call (the replacement of os.system) to run the command using the default shell of the OS. With this, one can use more advanced commands for bash, zsh, ksh, ... I do not have a win32 system to test this modification, so maybe line 2236 can also be changed like 2239.

File last commit:

r12039:0de1b7fc
r12217:56bf2f98
Show More
test_latex.py
51 lines | 1.7 KiB | text/x-python | PythonLexer
Jonathan Frederic
Added latex transformer test
r12030 """
Module with tests for the latex transformer
"""
#-----------------------------------------------------------------------------
# Copyright (c) 2013, the IPython Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
#-----------------------------------------------------------------------------
#-----------------------------------------------------------------------------
# Imports
#-----------------------------------------------------------------------------
from .base import TransformerTestsBase
from ..latex import LatexTransformer
#-----------------------------------------------------------------------------
# Class
#-----------------------------------------------------------------------------
class TestLatex(TransformerTestsBase):
"""Contains test functions for latex.py"""
Jonathan Frederic
Fixes small things pointed out by @minrk
r12035
def build_transformer(self):
"""Make an instance of a transformer"""
Jonathan Frederic
Added latex transformer test
r12030 transformer = LatexTransformer()
transformer.enabled = True
return transformer
Jonathan Frederic
Fixes small things pointed out by @minrk
r12035
def test_constructor(self):
"""Can a LatexTransformer be constructed?"""
self.build_transformer()
Jonathan Frederic
Added latex transformer test
r12030
def test_output(self):
"""Test the output of the LatexTransformer"""
Jonathan Frederic
Expanded transformer pass line, for easier debugging
r12039 nb = self.build_notebook()
res = self.build_resources()
transformer = self.build_transformer()
nb, res = transformer(nb, res)
Jonathan Frederic
Added latex transformer test
r12030
# Make sure the code cell wasn't modified.
self.assertEqual(nb.worksheets[0].cells[0].input, '$ e $')
# Verify that the markdown cell was processed.
self.assertEqual(nb.worksheets[0].cells[1].source, '$e$')