def testMultipleZCML(self): zcml.load_string('''\ <configure xmlns:transmogrifier="http://namespaces.plone.org/transmogrifier"> <transmogrifier:stylesheet source="marshall" from="Blog" to="Weblog" file="blog.xsl" /> <transmogrifier:stylesheet source="propertymanager" from="BlogEntry" to="WeblogEntry" file="blogentry.xsl" /> </configure>''') self.assertEqual(stylesheet_registry.listStylesheetNames(), (u'marshall:Blog:Weblog', u'propertymanager:BlogEntry:WeblogEntry'))
def testConfigZCML(self): zcml.load_string('''\ <configure xmlns:transmogrifier="http://namespaces.plone.org/transmogrifier"> <transmogrifier:stylesheet source="marshall" from="Blog" to="Weblog" file="blog.xsl" /> </configure>''') self.assertEqual(stylesheet_registry.listStylesheetNames(), (u'marshall:Blog:Weblog',)) path = os.path.split(quintagroup.transmogrifier.__file__)[0] self.assertEqual( stylesheet_registry.getStylesheet('marshall', 'Blog', 'Weblog'), dict(from_=u'Blog', to=u'Weblog', file=os.path.join(path, 'blog.xsl')) )
def testEmptyZCML(self): zcml.load_string('''\ <configure xmlns:transmogrifier="http://namespaces.plone.org/transmogrifier"> </configure>''') self.assertEqual(stylesheet_registry.listStylesheetNames(), ())