[Zope-CVS] CVS: Packages/pypes/pypes/tests - common.py:1.7
Casey Duncan
casey at zope.com
Wed Mar 10 16:18:05 EST 2004
Update of /cvs-repository/Packages/pypes/pypes/tests
In directory cvs.zope.org:/tmp/cvs-serv20475/tests
Modified Files:
common.py
Log Message:
Allow test objects to contain arbitrary attrs based on kwargs passed to the constructor
=== Packages/pypes/pypes/tests/common.py 1.6 => 1.7 ===
--- Packages/pypes/pypes/tests/common.py:1.6 Sun Mar 7 05:09:13 2004
+++ Packages/pypes/pypes/tests/common.py Wed Mar 10 16:18:03 2004
@@ -22,7 +22,10 @@
from unittest import TestCase
class TestClass(Persistent):
- pass
+ """Dummy test object"""
+ def __init__(self, **kw):
+ for name, value in kw.items():
+ setattr(self, name, value)
class TestConnection(Connection):
"""Dummy ZODB connection for testing"""
@@ -60,8 +63,8 @@
pypes.initialize(self.conn)
self.identity = pypes.services.identity(self.conn)
- def _newObj(self):
- obj = TestClass()
+ def _newObj(self, **kw):
+ obj = TestClass(**kw)
self.identity.register(obj)
return obj
More information about the Zope-CVS
mailing list