[Zodb-checkins] CVS: Zope3/src/persistence/tests - test_wrapper.py:1.1.2.1

Jim Fulton jim at zope.com
Tue Oct 7 05:40:24 EDT 2003


Update of /cvs-repository/Zope3/src/persistence/tests
In directory cvs.zope.org:/tmp/cvs-serv6614/src/persistence/tests

Modified Files:
      Tag: schema-utility-struct-failure
	test_wrapper.py 
Log Message:
Removed the test for IPersistent.

We can't expose IPersistent without a special interface
descriptor. Adding this would add too much dependence on
zope.interface. In any case, I'm refactoring interfaces in a major way
right now that would probably require changing this again.


=== Zope3/src/persistence/tests/test_wrapper.py 1.1 => 1.1.2.1 ===
--- Zope3/src/persistence/tests/test_wrapper.py:1.1	Fri Oct  3 16:44:34 2003
+++ Zope3/src/persistence/tests/test_wrapper.py	Tue Oct  7 05:40:24 2003
@@ -14,7 +14,6 @@
 import unittest
 
 from persistence import Persistent, PersistentMetaClass
-from persistence.interfaces import IPersistent
 from persistence.wrapper import Struct
 from persistence.tests.test_persistence import DM as BaseDM, BrokenDM
 
@@ -195,18 +194,25 @@
         self.assertEqual(p._p_state, 0)
         self.assertEqual(p.x, 42)
 
-    def testInterface(self):
-        self.assert_(IPersistent.isImplementedByInstancesOf(Persistent),
-                     "%s does not implement IPersistent" % Persistent)
-        p = Persistent()
-        self.assert_(IPersistent.isImplementedBy(p),
-                     "%s does not implement IPersistent" % p)
 
-        self.assert_(IPersistent.isImplementedByInstancesOf(Struct),
-                     "%s does not implement IPersistent" % Struct)
-        p = self.klass()
-        self.assert_(IPersistent.isImplementedBy(p),
-                     "%s does not implement IPersistent" % p)
+# XXX to do this right and expose both IPersistent and the
+# underlying object's interfaces, we'd need to use a specialized
+# descriptor.  This would create to great a dependency on
+# zope.interface.
+#
+##     def testInterface(self):
+##         from persistence.interfaces import IPersistent
+##         self.assert_(IPersistent.isImplementedByInstancesOf(Persistent),
+##                      "%s does not implement IPersistent" % Persistent)
+##         p = Persistent()
+##         self.assert_(IPersistent.isImplementedBy(p),
+##                      "%s does not implement IPersistent" % p)
+
+##         self.assert_(IPersistent.isImplementedByInstancesOf(Struct),
+##                      "%s does not implement IPersistent" % Struct)
+##         p = self.klass()
+##         self.assert_(IPersistent.isImplementedBy(p),
+##                      "%s does not implement IPersistent" % p)
 
     def testDataManagerAndAttributes(self):
         # Test to cover an odd bug where the instance __dict__ was




More information about the Zodb-checkins mailing list