Back to index

plone3  3.1.7
testBaseRegistry.py
Go to the documentation of this file.
00001 import unittest
00002 from Products.ResourceRegistries.tools.BaseRegistry import BaseRegistryTool
00003 
00004 class BaseRegistryTestCase(unittest.TestCase):
00005     def __init__(self):
00006         unittest.TestCase.__init__(self)
00007         self.registry = BaseRegistryTool()
00008 
00009     # Make sure we don't generate an id that could screw up traversal to
00010     # the cached resource.
00011     def testGenerateId(self):
00012         self.failIf('++' in self.registry.generateId('++resource++foobar.css'))
00013         self.failIf('/' in self.registry.generateId('++resource++foo/bar.css'))
00014 
00015     def runTest(self):
00016         self.testGenerateId()
00017 
00018 def test_suite():
00019     suite = unittest.TestSuite()
00020 
00021     suite.addTest(BaseRegistryTestCase())
00022 
00023     return suite
00024 
00025