[Zope3-checkins] CVS: Zope3/lib/python/Zope/App/DependencyFramework/tests - testDependable.py:1.1.6.1 BaseTestIDependable.py:NONE
Suresh Babu Eddala
sbabu@zeomega.com
Mon, 21 Oct 2002 11:33:10 -0400
Update of /cvs-repository/Zope3/lib/python/Zope/App/DependencyFramework/tests
In directory cvs.zope.org:/tmp/cvs-serv8922/lib/python/Zope/App/DependencyFramework/tests
Modified Files:
Tag: Zope3-Bangalore-TTW-Branch
testDependable.py
Removed Files:
Tag: Zope3-Bangalore-TTW-Branch
BaseTestIDependable.py
Log Message:
managing (add, delete and raising exceptions) of dependency objects
=== Zope3/lib/python/Zope/App/DependencyFramework/tests/testDependable.py 1.1 => 1.1.6.1 ===
--- Zope3/lib/python/Zope/App/DependencyFramework/tests/testDependable.py:1.1 Mon Oct 14 07:51:05 2002
+++ Zope3/lib/python/Zope/App/DependencyFramework/tests/testDependable.py Mon Oct 21 11:33:09 2002
@@ -17,15 +17,40 @@
$Id$
"""
-from BaseTestIDependable import BaseTestIDependable
-from unittest import TestCase, TestSuite, main, makeSuite
-
-class Test(BaseTestIDependable, TestCase):
+
+from unittest import TestCase, TestSuite, main, makeSuite
+from Zope.App.OFS.Annotation.AttributeAnnotations \
+ import AttributeAnnotations
+from Zope.App.tests.PlacelessSetup import PlacelessSetup
+class C:pass
+class Test(PlacelessSetup, TestCase):
+
+
def _Test__new(self):
from Zope.App.DependencyFramework.Dependable import Dependable
- return Dependable()
+ return Dependable(AttributeAnnotations(C()))
+
+ def testVerifyInterface(self):
+ from Interface.Verify import verifyObject
+ from Zope.App.DependencyFramework.IDependable import IDependable
+ object = self._Test__new()
+ verifyObject(IDependable, object)
+ def test(self):
+ dependable = self._Test__new()
+ self.failIf(dependable.dependents())
+ dependable.addDependent('/a/b')
+ dependable.addDependent('/c/d')
+ dependable.addDependent('/c/e')
+ dependents = list(dependable.dependents())
+ dependents.sort()
+ self.assertEqual(dependents, ['/a/b', '/c/d', '/c/e'])
+ dependable.removeDependent('/c/d')
+ dependents = list(dependable.dependents())
+ dependents.sort()
+ self.assertEqual(dependents, ['/a/b', '/c/e'])
+
def test_suite():
return TestSuite((
makeSuite(Test),
=== Removed File Zope3/lib/python/Zope/App/DependencyFramework/tests/BaseTestIDependable.py ===