[CMF-checkins] CVS: CMF/CMFUid/tests - test_uidhandling.py:1.7
Grégoire Weber
zope.org at incept.ch
Fri Aug 6 17:00:44 EDT 2004
Update of /cvs-repository/CMF/CMFUid/tests
In directory cvs.zope.org:/tmp/cvs-serv1714/tests
Modified Files:
test_uidhandling.py
Log Message:
- added unrestricted query tests
=== CMF/CMFUid/tests/test_uidhandling.py 1.6 => 1.7 ===
--- CMF/CMFUid/tests/test_uidhandling.py:1.6 Thu Aug 5 12:07:46 2004
+++ CMF/CMFUid/tests/test_uidhandling.py Fri Aug 6 17:00:44 2004
@@ -31,6 +31,9 @@
from Products.CMFCore.CatalogTool import CatalogTool
from Products.CMFUid.interfaces import IUniqueIdHandler
+from Products.CMFUid.interfaces import IUniqueIdBrainQuery
+from Products.CMFUid.interfaces import IUniqueIdUnrestrictedQuery
+
from Products.CMFUid.UniqueIdGeneratorTool import UniqueIdGeneratorTool
from Products.CMFUid.UniqueIdAnnotationTool import UniqueIdAnnotationTool
from Products.CMFUid.UniqueIdHandlerTool import UniqueIdHandlerTool
@@ -56,6 +59,8 @@
def test_interface(self):
handler = self.root.portal_uidhandler
verifyObject(IUniqueIdHandler, handler)
+ verifyObject(IUniqueIdBrainQuery, handler)
+ verifyObject(IUniqueIdUnrestrictedQuery, handler)
def test_getUidOfNotYetRegisteredObject(self):
handler = self.root.portal_uidhandler
@@ -72,10 +77,14 @@
self.assertEqual(handler.queryObject(100, None), None)
self.assertRaises(UniqueIdError, handler.getObject, 100)
+ self.assertEqual(handler.unrestrictedQueryObject(100, None), None)
+ self.assertRaises(UniqueIdError, handler.unrestrictedGetObject, 100)
uid = handler.register(dummy)
self.assertEqual(handler.queryObject(uid+1, None), None)
self.assertRaises(UniqueIdError, handler.getObject, uid+1)
+ self.assertEqual(handler.unrestrictedQueryObject(uid+1, None), None)
+ self.assertRaises(UniqueIdError, handler.unrestrictedGetObject, uid+1)
def test_getUidOfRegisteredObject(self):
handler = self.root.portal_uidhandler
@@ -90,6 +99,7 @@
uid = handler.register(dummy)
self.assertEqual(handler.getObject(uid), dummy)
+ self.assertEqual(handler.unrestrictedGetObject(uid), dummy)
def test_getUnregisteredObject(self):
handler = self.root.portal_uidhandler
@@ -100,6 +110,8 @@
handler.unregister(dummy)
self.assertEqual(handler.queryObject(uid, None), None)
self.assertRaises(UniqueIdError, handler.getObject, uid)
+ self.assertEqual(handler.unrestrictedQueryObject(uid, None), None)
+ self.assertRaises(UniqueIdError, handler.unrestrictedGetObject, uid)
def test_getUidOfUnregisteredObject(self):
handler = self.root.portal_uidhandler
More information about the CMF-checkins
mailing list