test_csshtmlheader.py 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. """
  2. Module with tests for the csshtmlheader preprocessor
  3. """
  4. #-----------------------------------------------------------------------------
  5. # Copyright (c) 2013, the IPython Development Team.
  6. #
  7. # Distributed under the terms of the Modified BSD License.
  8. #
  9. # The full license is in the file COPYING.txt, distributed with this software.
  10. #-----------------------------------------------------------------------------
  11. #-----------------------------------------------------------------------------
  12. # Imports
  13. #-----------------------------------------------------------------------------
  14. from .base import PreprocessorTestsBase
  15. from ..csshtmlheader import CSSHTMLHeaderPreprocessor
  16. #-----------------------------------------------------------------------------
  17. # Class
  18. #-----------------------------------------------------------------------------
  19. class TestCSSHTMLHeader(PreprocessorTestsBase):
  20. """Contains test functions for csshtmlheader.py"""
  21. def build_preprocessor(self):
  22. """Make an instance of a preprocessor"""
  23. preprocessor = CSSHTMLHeaderPreprocessor()
  24. preprocessor.enabled = True
  25. return preprocessor
  26. def test_constructor(self):
  27. """Can a CSSHTMLHeaderPreprocessor be constructed?"""
  28. self.build_preprocessor()
  29. def test_output(self):
  30. """Test the output of the CSSHTMLHeaderPreprocessor"""
  31. nb = self.build_notebook()
  32. res = self.build_resources()
  33. preprocessor = self.build_preprocessor()
  34. nb, res = preprocessor(nb, res)
  35. assert 'css' in res['inlining']