[Zope-CVS] CVS: Products/BTreeFolder2/tests - testBTreeFolder2.py:1.2
Shane Hathaway
shane@cvs.zope.org
Wed, 8 May 2002 13:18:24 -0400
Update of /cvs-repository/Products/BTreeFolder2/tests
In directory cvs.zope.org:/tmp/cvs-serv10047/tests
Modified Files:
testBTreeFolder2.py
Log Message:
Some corrections and more tests
=== Products/BTreeFolder2/tests/testBTreeFolder2.py 1.1.1.1 => 1.2 ===
def testSetObject(self):
- raise NotImplementedError
+ f2 = BTreeFolder2('item2')
+ self.f._setObject(f2.id, f2)
+ self.assert_(self.f.hasObject('item2'))
+ self.assertEqual(self.f.objectCount(), 2)
+
+ def testWrapped(self):
+ base = aq_base(self.f._getOb('item'))
+ self.assert_(self.f._getOb('item') is not base)
+ self.assert_(self.f['item'] is not base)
+ self.assert_(self.f.get('item') is not base)
+ self.assert_(self.f._getOb('item').aq_base is base)
def testGenerateId(self):
- raise NotImplementedError
+ ids = {}
+ for n in range(10):
+ ids[self.f.generateId()] = 1
+ self.assertEqual(len(ids), 10) # All unique
+ for id in ids.keys():
+ self.f._checkId(id) # Must all be valid
## def testSuperValues(self):
## lst = list(self.f['item'].superValues('BTreeFolder2'))