##// 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:

r12143:2aec6283
r12217:56bf2f98
Show More
test_csshtmlheader.py
46 lines | 1.5 KiB | text/x-python | PythonLexer
Jonathan Frederic
Added base transformers test class and added CSSHTMLHeaderTransformer tests
r12023 """
Module with tests for the csshtmlheader 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 ..csshtmlheader import CSSHTMLHeaderTransformer
#-----------------------------------------------------------------------------
# Class
#-----------------------------------------------------------------------------
class TestCSSHTMLHeader(TransformerTestsBase):
"""Contains test functions for csshtmlheader.py"""
Jonathan Frederic
Fixes small things pointed out by @minrk
r12035
def build_transformer(self):
"""Make an instance of a transformer"""
Jonathan Frederic
Enabled Transformer
r12028 transformer = CSSHTMLHeaderTransformer()
transformer.enabled = True
return transformer
Jonathan Frederic
Fixes small things pointed out by @minrk
r12035
def test_constructor(self):
"""Can a CSSHTMLHeaderTransformer be constructed?"""
self.build_transformer()
Jonathan Frederic
Added base transformers test class and added CSSHTMLHeaderTransformer tests
r12023
def test_output(self):
"""Test the output of the CSSHTMLHeaderTransformer"""
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
Inlining is not an attribute of resources
r12024 assert 'css' in res['inlining']