Back to index

plone3  3.1.7
Classes | Functions
Archetypes.tests.test_utils Namespace Reference

Classes

class  UidGeneratorTest
class  DisplayListTest

Functions

def test_suite
 def test_getIndex(self): a = ((None,'a',), (2,'b'), ('c', 'c')) dla = DisplayList(a)

Function Documentation

def test_getIndex(self): a = ((None,'a',), (2,'b'), ('c', 'c')) dla = DisplayList(a)

self.assertEquals(dla.getIndex(None), 1)
self.assertEquals(dla.getIndex(2), 2)
self.assertEquals(dla.getIndex('c'), 3)

def test_getIndexesFromKeys(self): a = ((None,'a',), (2,'b'), ('c', 'c')) dla = DisplayList(a)

self.assertEquals(dla.getIndexesFromKeys([None, 2]), [1,2]) self.failUnless(dla.getIndexesFromKeys([None, 'a']) == [1])

def test_getKeysFromIndexes(self): a = ((None,'a',), (2,'b'), ('c', 'c')) dla = DisplayList(a)

self.assertEquals(dla.getKeysFromIndexes([1,2]), [None, 2]) self.failUnless(dla.getKeysFromIndexes([1,5]) == [None])

Definition at line 179 of file test_utils.py.

00179 
00180 def test_suite():
00181     from unittest import TestSuite, makeSuite
00182     suite = TestSuite()
00183     suite.addTest(makeSuite(DisplayListTest))
00184     suite.addTest(makeSuite(UidGeneratorTest))
00185     return suite