[Zope3-checkins]
SVN: Zope3/trunk/src/zope/app/interface/tests/test_interface.py
merge r72243 from branches/3.3
Ross Patterson
me at rpatterson.net
Sat Jan 27 18:37:29 EST 2007
Log message for revision 72244:
merge r72243 from branches/3.3
Remove non-persistent stuff from weakref tests for factoring out into
a separate test included in a patch in:
http://www.zope.org/Collectors/Zope3-dev/750
Changed:
U Zope3/trunk/src/zope/app/interface/tests/test_interface.py
-=-
Modified: Zope3/trunk/src/zope/app/interface/tests/test_interface.py
===================================================================
--- Zope3/trunk/src/zope/app/interface/tests/test_interface.py 2007-01-27 23:32:53 UTC (rev 72243)
+++ Zope3/trunk/src/zope/app/interface/tests/test_interface.py 2007-01-27 23:37:28 UTC (rev 72244)
@@ -110,39 +110,28 @@
bar = root['bar']
self.assertTrue(barmodule.IBar.providedBy(bar))
- def test_weakref(self):
+ def test_persistentWeakref(self):
"""Verify interacton of declaration weak refs with ZODB
Weak references to persistent objects don't remain after ZODB
pack and garbage collection."""
bar = self.root['bar'] = Bar()
- baz = self.root['baz'] = Baz()
-
self.registry.newModule("barmodule", bar_code)
barmodule = self.registry.findModule("barmodule")
-
- self.assertEqual(IQux.dependents.keys(), [])
self.assertEqual(barmodule.IBar.dependents.keys(), [])
-
- directlyProvides(baz, IQux)
directlyProvides(bar, barmodule.IBar)
-
- self.assertEqual(len(IQux.dependents), 1)
self.assertEqual(len(barmodule.IBar.dependents), 1)
transaction.commit()
del bar
del self.root['bar']
- del baz
- del self.root['baz']
self.db.pack()
transaction.commit()
collect()
root = self.db.open().root()
barmodule = root['registry'].findModule("barmodule")
-
self.assertEqual(barmodule.IBar.dependents.keys(), [])
def test_persistentDeclarations(self):
@@ -165,7 +154,6 @@
bar.__provides__._Provides__args,
barmodule.IBar.dependents.keys()[0]._Provides__args
)
-
self.assertEqual(
Baz.__implemented__.__bases__,
barmodule.IBar.dependents.keys()[1].__bases__
More information about the Zope3-Checkins
mailing list