Back to index

plone3  3.1.7
Public Member Functions | Public Attributes
Archetypes.tests.test_utils2.OrderedDictTest Class Reference
Inheritance diagram for Archetypes.tests.test_utils2.OrderedDictTest:
Inheritance graph
[legend]
Collaboration diagram for Archetypes.tests.test_utils2.OrderedDictTest:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def afterSetUp
def test_order
def test_setitem
def test_del
def test_clear
def test_update
def test_popitem

Public Attributes

 d

Detailed Description

Definition at line 33 of file test_utils2.py.


Member Function Documentation

Definition at line 35 of file test_utils2.py.

00035 
00036     def afterSetUp(self):
00037         self.d = OrderedDict()
00038         self.d['a'] = '1'
00039         self.d['b'] = '2'
00040         self.d['c'] = '3'

Definition at line 69 of file test_utils2.py.

00069 
00070     def test_clear(self):
00071         self.d.clear()
00072         self.failUnless(self.d.keys() == [])
00073         self.failUnless(self.d.values() == [])
00074         self.failUnless(self.d.items() == [])
00075         self.failUnless(self.d.reverse() == [])

Definition at line 60 of file test_utils2.py.

00060 
00061     def test_del(self):
00062         del self.d['b']
00063         self.failUnless(self.d.keys() == ['a','c'])
00064         self.failUnless(self.d.values() == ['1','3'])
00065         self.failUnless(self.d.items() == [('a','1'),('c','3')])
00066         self.failUnless(self.d.reverse() == [('c','3'),('a','1')])
00067         self.failIf(self.d.has_key('b'))
00068         self.failUnless(self.d.get('b',None) == None)

Definition at line 41 of file test_utils2.py.

00041 
00042     def test_order(self):
00043         self.failUnless(self.d.keys() == ['a','b','c'])
00044         self.failUnless(self.d.values() == ['1','2','3'])
00045         self.failUnless(self.d.items() == [('a','1'),('b','2'),('c','3')])
00046         self.failUnless(self.d.reverse() == [('c','3'),('b','2'),('a','1')])

Definition at line 84 of file test_utils2.py.

00084 
00085     def test_popitem(self):
00086         (k,v) = self.d.popitem()
00087         self.failUnless(k == 'c')
00088         self.failUnless(v == '3')
00089         

Definition at line 47 of file test_utils2.py.

00047 
00048     def test_setitem(self):
00049         self.d['d'] = '4'
00050         self.failUnless(self.d.keys() == ['a','b','c','d'])
00051         self.failUnless(self.d.values() == ['1','2','3','4'])
00052         self.failUnless(self.d.items() == [('a','1'),('b','2'),('c','3'),('d','4')])
00053         self.failUnless(self.d.reverse() == [('d','4'),('c','3'),('b','2'),('a','1')])
00054 
00055         self.d['c'] = 'C'
00056         self.failUnless(self.d.keys() == ['a','b','c','d'])
00057         self.failUnless(self.d.values() == ['1','2','C','4'])
00058         self.failUnless(self.d.items() == [('a','1'),('b','2'),('c','C'),('d','4')])
00059         self.failUnless(self.d.reverse() == [('d','4'),('c','C'),('b','2'),('a','1')])

Definition at line 76 of file test_utils2.py.

00076 
00077     def test_update(self):
00078         d2 = {'b':'B','d':'4'}
00079         self.d.update(d2)
00080         self.failUnless(self.d.keys() == ['a','b','c','d'])
00081         self.failUnless(self.d.values() == ['1','B','3','4'])
00082         self.failUnless(self.d.items() == [('a','1'),('b','B'),('c','3'),('d','4')])
00083         self.failUnless(self.d.reverse() == [('d','4'),('c','3'),('b','B'),('a','1')])


Member Data Documentation

Definition at line 36 of file test_utils2.py.


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