[CMF-checkins] CVS: CMF/CMFCore/tests/base - dummy.py:1.6.8.1
Yvo Schubbe
schubbe@web.de
Tue, 27 May 2003 13:16:58 -0400
Update of /cvs-repository/CMF/CMFCore/tests/base
In directory cvs.zope.org:/tmp/cvs-serv13566/CMFCore/tests/base
Modified Files:
Tag: yuppie-collector162-branch
dummy.py
Log Message:
- added and modified dummies for use in test_MembershipTool.py
=== CMF/CMFCore/tests/base/dummy.py 1.6 => 1.6.8.1 ===
--- CMF/CMFCore/tests/base/dummy.py:1.6 Tue Apr 15 12:08:02 2003
+++ CMF/CMFCore/tests/base/dummy.py Tue May 27 13:16:58 2003
@@ -11,21 +11,24 @@
Comes with getIcon and restrictedTraverse
methods.
"""
- def __init__(self, name='dummy',**kw):
- self.name = name
+ def __init__(self, id='dummy',**kw):
+ self.id = id
self.__dict__.update( kw )
def __str__(self):
- return self.name
+ return self.id
def __call__(self):
- return self.name
+ return self.id
def restrictedTraverse( self, path ):
return path and getattr( self, path ) or self
def getIcon( self, relative=0 ):
return 'Site: %s' % relative
+
+ def getId(self):
+ return self.id
class DummyContent( PortalContent, Item ):
"""
@@ -163,6 +166,19 @@
def _setObject(self,id,object):
setattr(self,id,object)
+
+class DummyUserFolder(DummyFolder):
+ def __init__(self):
+ self._setObject( 'user_foo', DummyObject(id='user_foo') )
+ self._setObject( 'user_bar', DummyObject(id='user_bar') )
+ def getUsers(self):
+ pass
+ def getUser(self, name):
+ return getattr(self, name, None)
+ def getUserById(self, id, default=None):
+ return self.getUser(id)
+
+
class DummyTool(Implicit,ActionProviderBase):
"""
This is a Dummy Tool that behaves as a
@@ -195,3 +211,7 @@
def getIcon( self, relative=0 ):
return 'Tool: %s' % relative
+
+ # WorkflowTool
+ def notifyCreated(self, ob):
+ pass