Handle case where neither xslt nor genshi are installed

This commit is contained in:
Sam Ruby 2007-05-16 01:05:00 -04:00
parent c9e209ba8d
commit c2ff924372

View File

@ -100,6 +100,13 @@ class ApplyTest(unittest.TestCase):
html = open(os.path.join(workdir, 'index.html')).read() html = open(os.path.join(workdir, 'index.html')).read()
self.assertTrue(html.find(' href="http://example.com/default.css"')>=0) self.assertTrue(html.find(' href="http://example.com/default.css"')>=0)
import test_filter_genshi
for method in dir(test_filter_genshi.GenshiFilterTests):
if method.startswith('test_'): break
else:
delattr(ApplyTest,'test_apply_genshi_fancy')
delattr(ApplyTest,'test_apply_filter_html')
try: try:
import libxml2 import libxml2
except ImportError: except ImportError:
@ -122,10 +129,3 @@ except ImportError:
logger.warn("xsltproc is not available => can't test XSLT templates") logger.warn("xsltproc is not available => can't test XSLT templates")
for method in dir(ApplyTest): for method in dir(ApplyTest):
if method.startswith('test_'): delattr(ApplyTest,method) if method.startswith('test_'): delattr(ApplyTest,method)
import test_filter_genshi
for method in dir(test_filter_genshi.GenshiFilterTests):
if method.startswith('test_'): break
else:
delattr(ApplyTest,'test_apply_genshi_fancy')
delattr(ApplyTest,'test_apply_filter_html')