[Zope-Checkins] CVS: Zope3/lib/python/Zope/ComponentArchitecture/tests - testAPI.py:1.1.2.6
Martijn Pieters
mj@zope.com
Mon, 3 Dec 2001 11:55:37 -0500
Update of /cvs-repository/Zope3/lib/python/Zope/ComponentArchitecture/tests
In directory cvs.zope.org:/tmp/cvs-serv13578/lib/python/Zope/ComponentArchitecture/tests
Modified Files:
Tag: Zope-3x-branch
testAPI.py
Log Message:
Add testcase for forInterface = None.
=== Zope3/lib/python/Zope/ComponentArchitecture/tests/testAPI.py 1.1.2.5 => 1.1.2.6 ===
class Test(unittest.TestCase):
+ def tearDown(self):
+ # Assure a cleared registry for the next run.
+ from Zope.ComponentArchitecture import _clear
+ _clear()
def testFeature(self):
from Zope.ComponentArchitecture import getFeature, provideFeature
@@ -33,6 +37,14 @@
provideFeature(I1, I2, Comp)
c=getFeature(ob, I2)
+ self.assertEquals(c.__class__, Comp)
+ self.assertEquals(c.getContext(), ob)
+
+ def testFeatureForInterfaceNone(self):
+ from Zope.ComponentArchitecture import getFeature, provideFeature
+
+ provideFeature(None, I2, Comp)
+ c = getFeature(ob, I2)
self.assertEquals(c.__class__, Comp)
self.assertEquals(c.getContext(), ob)