Back to index

plone3  3.1.7
Public Member Functions | Public Attributes
ResourceRegistries.tests.testKSSRegistry.TestKineticStylesheetCooking Class Reference
Inheritance diagram for ResourceRegistries.tests.testKSSRegistry.TestKineticStylesheetCooking:
Inheritance graph
[legend]
Collaboration diagram for ResourceRegistries.tests.testKSSRegistry.TestKineticStylesheetCooking:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def afterSetUp
def testKineticStylesheetCooking
def testKineticStylesheetCookingValues
def testGetEvaluatedKineticStylesheetsCollapsing
def testMoreComplexKineticStylesheetsCollapsing
def testGetEvaluatedKineticStylesheetsWithExpression
def testGetEvaluatedKineticStylesheetsWithFailingExpression
def testGetEvaluatedKineticStylesheetsWithContextualExpression
def testCollapsingKineticStylesheetsLookup
def testRenderingIsInTheRightOrder
def testConcatenatedSheetsAreInTheRightOrderToo

Public Attributes

 tool

Detailed Description

Definition at line 174 of file testKSSRegistry.py.


Member Function Documentation

Definition at line 176 of file testKSSRegistry.py.

00176 
00177     def afterSetUp(self):
00178         self.tool = getattr(self.portal, KSSTOOLNAME)
00179         self.tool.clearResources()

Definition at line 250 of file testKSSRegistry.py.

00250 
00251     def testCollapsingKineticStylesheetsLookup(self):
00252         self.tool.registerKineticStylesheet('ham')
00253         self.tool.registerKineticStylesheet('spam', expression='string:ham')
00254         self.tool.registerKineticStylesheet('spam spam', expression='string:ham')
00255         evaluated = self.tool.getEvaluatedResources(self.folder)
00256         self.assertEqual(len(evaluated), 2)
00257         self.tool.setAutoGroupingMode(True)
00258         evaluated = self.tool.getEvaluatedResources(self.folder)
00259         self.assertEqual(len(evaluated), 2)

Here is the call graph for this function:

Definition at line 272 of file testKSSRegistry.py.

00272 
00273     def testConcatenatedSheetsAreInTheRightOrderToo(self):
00274         self.tool.registerKineticStylesheet('ham')
00275         self.tool.registerKineticStylesheet('spam')
00276         self.tool.registerKineticStylesheet('eggs')
00277         evaluated = self.tool.getEvaluatedResources(self.folder)
00278         results = self.tool.concatenatedresources[evaluated[0].getId()]
00279         self.failUnless(results[0] == 'ham')
00280         self.failUnless(results[1] == 'spam')
00281         self.failUnless(results[2] == 'eggs')
00282         self.tool.setAutoGroupingMode(True)
00283         evaluated = self.tool.getEvaluatedResources(self.folder)
00284         results = self.tool.concatenatedresources[evaluated[0].getId()]
00285         self.failUnless(results[0] == 'ham')
00286         self.failUnless(results[1] == 'spam')
00287         self.failUnless(results[2] == 'eggs')
00288 

Here is the call graph for this function:

Definition at line 200 of file testKSSRegistry.py.

00200 
00201     def testGetEvaluatedKineticStylesheetsCollapsing(self):
00202         self.tool.registerKineticStylesheet('ham')
00203         self.tool.registerKineticStylesheet('spam')
00204         self.tool.registerKineticStylesheet('eggs')
00205         self.assertEqual(len(self.tool.getEvaluatedResources(self.folder)), 1)

Here is the call graph for this function:

Definition at line 243 of file testKSSRegistry.py.

00243 
00244     def testGetEvaluatedKineticStylesheetsWithContextualExpression(self):
00245         self.folder.invokeFactory('Document', 'eggs')
00246         self.tool.registerKineticStylesheet('spam', expression='python:"eggs" in object.objectIds()')
00247         self.assertEqual(len(self.tool.getEvaluatedResources(self.folder)), 1)
00248         self.tool.setAutoGroupingMode(True)
00249         self.assertEqual(len(self.tool.getEvaluatedResources(self.folder)), 1)

Here is the call graph for this function:

Definition at line 229 of file testKSSRegistry.py.

00229 
00230     def testGetEvaluatedKineticStylesheetsWithExpression(self):
00231         self.tool.registerKineticStylesheet('ham')
00232         self.tool.registerKineticStylesheet('spam', expression='python:1')
00233         self.assertEqual(len(self.tool.getEvaluatedResources(self.folder)), 2)
00234         self.tool.setAutoGroupingMode(True)
00235         self.assertEqual(len(self.tool.getEvaluatedResources(self.folder)), 2)

Here is the call graph for this function:

Definition at line 236 of file testKSSRegistry.py.

00236 
00237     def testGetEvaluatedKineticStylesheetsWithFailingExpression(self):
00238         self.tool.registerKineticStylesheet('ham')
00239         self.tool.registerKineticStylesheet('spam', expression='python:0')
00240         self.assertEqual(len(self.tool.getEvaluatedResources(self.folder)), 1)
00241         self.tool.setAutoGroupingMode(True)
00242         self.assertEqual(len(self.tool.getEvaluatedResources(self.folder)), 1)

Here is the call graph for this function:

Definition at line 180 of file testKSSRegistry.py.

00180 
00181     def testKineticStylesheetCooking(self):
00182         self.tool.registerKineticStylesheet('ham')
00183         self.tool.registerKineticStylesheet('spam')
00184         self.tool.registerKineticStylesheet('eggs')
00185         self.assertEqual(len(self.tool.getResources()), 3)
00186         self.assertEqual(len(self.tool.cookedresources), 1)
00187         self.assertEqual(len(self.tool.concatenatedresources.keys()), 4)
00188         self.tool.setAutoGroupingMode(True)
00189         self.assertEqual(len(self.tool.getResources()), 3)
00190         self.assertEqual(len(self.tool.cookedresources), 1)
00191         self.assertEqual(len(self.tool.concatenatedresources.keys()), 4)

Definition at line 192 of file testKSSRegistry.py.

00192 
00193     def testKineticStylesheetCookingValues(self):
00194         self.tool.registerKineticStylesheet('ham')
00195         self.tool.registerKineticStylesheet('spam')
00196         self.tool.registerKineticStylesheet('eggs')
00197         self.assertEqual(self.tool.concatenatedresources[
00198                          self.tool.cookedresources[0].getId()],
00199                          ['ham', 'spam', 'eggs'])

Definition at line 206 of file testKSSRegistry.py.

00206 
00207     def testMoreComplexKineticStylesheetsCollapsing(self):
00208         self.tool.registerKineticStylesheet('ham')
00209         self.tool.registerKineticStylesheet('spam', expression='string:spam')
00210         self.tool.registerKineticStylesheet('spam spam', expression='string:spam')
00211         self.tool.registerKineticStylesheet('spam spam spam', expression='string:spam')
00212         self.tool.registerKineticStylesheet('eggs')
00213         self.assertEqual(len(self.tool.getEvaluatedResources(self.folder)), 3)
00214         magic_ids = [item.getId() for item in self.tool.getEvaluatedResources(self.folder)]
00215         self.failUnless('ham' in self.tool.concatenatedresources[magic_ids[0]])
00216         self.failUnless('eggs' in self.tool.concatenatedresources[magic_ids[2]])
00217         self.failUnless('spam' in self.tool.concatenatedresources[magic_ids[1]])
00218         self.failUnless('spam spam' in self.tool.concatenatedresources[magic_ids[1]])
00219         self.failUnless('spam spam spam' in self.tool.concatenatedresources[magic_ids[1]])
00220 
00221         self.tool.setAutoGroupingMode(True)
00222         self.assertEqual(len(self.tool.getEvaluatedResources(self.folder)), 2)
00223         magic_ids = [item.getId() for item in self.tool.getEvaluatedResources(self.folder)]
00224         self.failUnless('ham' in self.tool.concatenatedresources[magic_ids[0]])
00225         self.failUnless('eggs' in self.tool.concatenatedresources[magic_ids[0]])
00226         self.failUnless('spam' in self.tool.concatenatedresources[magic_ids[1]])
00227         self.failUnless('spam spam' in self.tool.concatenatedresources[magic_ids[1]])
00228         self.failUnless('spam spam spam' in self.tool.concatenatedresources[magic_ids[1]])

Here is the call graph for this function:

Definition at line 260 of file testKSSRegistry.py.

00260 
00261     def testRenderingIsInTheRightOrder(self):
00262         self.tool.registerKineticStylesheet('ham', expression='string:ham')
00263         self.tool.registerKineticStylesheet('spam', expression='string:spam')
00264         evaluated = self.tool.getEvaluatedResources(self.folder)
00265         magic_ids = [item.getId() for item in evaluated]
00266         ids = []
00267         for magic_id in magic_ids:
00268             self.assertEqual(len(self.tool.concatenatedresources[magic_id]), 1)
00269             ids.append(self.tool.concatenatedresources[magic_id][0])
00270         self.failUnless(ids[0] == 'ham')
00271         self.failUnless(ids[1] == 'spam')

Here is the call graph for this function:


Member Data Documentation

Definition at line 177 of file testKSSRegistry.py.


The documentation for this class was generated from the following file: