diff options
| author | Chris McDonough <chrism@agendaless.com> | 2009-01-15 01:05:18 +0000 |
|---|---|---|
| committer | Chris McDonough <chrism@agendaless.com> | 2009-01-15 01:05:18 +0000 |
| commit | 7cd5d4bf56a8ccd6ae2eeb0cd4be0f1688892e0f (patch) | |
| tree | 0e742f4fbe2d842125b06694dbd6aed40f5a37a4 /repoze/bfg/tests/test_xslt.py | |
| parent | c8cf2256655ee4b34ec501325b9016608b5cce5f (diff) | |
| download | pyramid-7cd5d4bf56a8ccd6ae2eeb0cd4be0f1688892e0f.tar.gz pyramid-7cd5d4bf56a8ccd6ae2eeb0cd4be0f1688892e0f.tar.bz2 pyramid-7cd5d4bf56a8ccd6ae2eeb0cd4be0f1688892e0f.zip | |
Test coverage.
Diffstat (limited to 'repoze/bfg/tests/test_xslt.py')
| -rw-r--r-- | repoze/bfg/tests/test_xslt.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/repoze/bfg/tests/test_xslt.py b/repoze/bfg/tests/test_xslt.py index 38e693937..eed0fc808 100644 --- a/repoze/bfg/tests/test_xslt.py +++ b/repoze/bfg/tests/test_xslt.py @@ -198,3 +198,24 @@ class RenderTransformTests(Base, unittest.TestCase): self.assertEqual(result, resultstr) self.assertEqual(queryUtility(INodeTemplateRenderer, minimal), utility) +class TestGetProcessor(Base, unittest.TestCase): + def _callFUT(self, fn, auto_reload=False): + from repoze.bfg.xslt import get_processor + return get_processor(fn, auto_reload) + + def test_no_processors(self): + from lxml.etree import XSLT + from repoze.bfg.xslt import xslt_pool + del xslt_pool.processors + path = self._getTemplatePath('minimal.xsl') + result = self._callFUT(path) + self.failUnless(isinstance(result, XSLT)) + + def test_empty_processors(self): + from lxml.etree import XSLT + from repoze.bfg.xslt import xslt_pool + xslt_pool.processors = {} + path = self._getTemplatePath('minimal.xsl') + result = self._callFUT(path) + self.failUnless(isinstance(result, XSLT)) + |
