Back to index

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

List of all members.

Public Member Functions

def afterSetUp
def testStoringKineticStylesheet
def testDefaultKineticStylesheetAttributes
def testKineticStylesheetAttributes
def testDisallowingDuplicateIds
def testUnregisterKineticStylesheet
def testKineticStylesheetsDict

Public Attributes

 tool

Detailed Description

Definition at line 53 of file testKSSRegistry.py.


Member Function Documentation

Definition at line 55 of file testKSSRegistry.py.

00055 
00056     def afterSetUp(self):
00057         self.tool = getattr(self.portal, KSSTOOLNAME)
00058         self.tool.clearResources()

Definition at line 64 of file testKSSRegistry.py.

00064 
00065     def testDefaultKineticStylesheetAttributes(self):
00066         self.tool.registerKineticStylesheet('foodefault')
00067         self.assertEqual(self.tool.getResources()[0].getId(), 'foodefault')
00068         self.assertEqual(self.tool.getResources()[0].getExpression(), '')
00069         self.failUnless(self.tool.getResources()[0].getEnabled())

Definition at line 77 of file testKSSRegistry.py.

00077 
00078     def testDisallowingDuplicateIds(self):
00079         self.tool.registerKineticStylesheet('foo')
00080         self.assertRaises(ValueError, self.tool.registerKineticStylesheet, 'foo')

Definition at line 70 of file testKSSRegistry.py.

00070 
00071     def testKineticStylesheetAttributes(self):
00072         self.tool.registerKineticStylesheet('foo', expression='python:1',
00073                                             enabled=0)
00074         self.assertEqual(self.tool.getResources()[0].getId(), 'foo')
00075         self.assertEqual(self.tool.getResources()[0].getExpression(), 'python:1')
00076         self.failIf(self.tool.getResources()[0].getEnabled())

Definition at line 88 of file testKSSRegistry.py.

00088 
00089     def testKineticStylesheetsDict(self):
00090         self.tool.registerKineticStylesheet('spam')
00091         self.tool.registerKineticStylesheet('ham')
00092         keys = self.tool.getResourcesDict().keys()
00093         keys.sort()
00094         res = ['ham', 'spam']
00095         res.sort()
00096         self.assertEqual(res, keys)
00097         self.assertEqual(self.tool.getResourcesDict()['ham'].getId(), 'ham')
00098 

Definition at line 59 of file testKSSRegistry.py.

00059 
00060     def testStoringKineticStylesheet(self):
00061         self.tool.registerKineticStylesheet('foo')
00062         self.assertEqual(len(self.tool.getResources()), 1)
00063         self.assertEqual(self.tool.getResources()[0].getId(), 'foo')

Definition at line 81 of file testKSSRegistry.py.

00081 
00082     def testUnregisterKineticStylesheet(self):
00083         self.tool.registerKineticStylesheet('foo')
00084         self.assertEqual(len(self.tool.getResources()), 1)
00085         self.assertEqual(self.tool.getResources()[0].getId(), 'foo')
00086         self.tool.unregisterResource('foo')
00087         self.assertEqual(len(self.tool.getResources()), 0)


Member Data Documentation

Definition at line 56 of file testKSSRegistry.py.


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