[Zope3-checkins] CVS: Zope3/src/zope/component/tests -
test_factory.py:1.3
Bjorn Tillenius
bjoti777 at student.liu.se
Tue Mar 9 10:27:33 EST 2004
Update of /cvs-repository/Zope3/src/zope/component/tests
In directory cvs.zope.org:/tmp/cvs-serv11562/src/zope/component/tests
Modified Files:
test_factory.py
Log Message:
By making Factory.getInterfaces() return a list, a few things got broken.
Changed it back to the way ClassFactory.getInterfaces() worked.
=== Zope3/src/zope/component/tests/test_factory.py 1.2 => 1.3 ===
--- Zope3/src/zope/component/tests/test_factory.py:1.2 Tue Mar 9 07:40:07 2004
+++ Zope3/src/zope/component/tests/test_factory.py Tue Mar 9 10:27:32 2004
@@ -17,6 +17,7 @@
"""
import unittest
from zope.interface import Interface, implements
+from zope.interface.interfaces import IDeclaration
from zope.component import createObject, getFactoryInterfaces, getFactoriesFor
from zope.component.interfaces import IFactory
@@ -51,7 +52,9 @@
self.assertEqual(self._factory.description, 'Klassier')
def testGetInterfaces(self):
- self.assertEqual(self._factory.getInterfaces(), [IKlass])
+ implemented = self._factory.getInterfaces()
+ self.assert_(implemented.isOrExtends(IKlass))
+ self.assertEqual([iface for iface in implemented], [IKlass])
class TestFactoryZAPIFunctions(PlacelessSetup, unittest.TestCase):
@@ -68,7 +71,9 @@
self.assertEqual(kl.kw, {'foo': 4})
def testGetFactoryInterfaces(self):
- self.assertEqual(getFactoryInterfaces(None, 'klass'), [IKlass])
+ implemented = getFactoryInterfaces(None, 'klass')
+ self.assert_(implemented.isOrExtends(IKlass))
+ self.assertEqual([iface for iface in implemented], [IKlass])
def testGetFactoriesFor(self):
self.assertEqual(getFactoriesFor(None, IKlass),
More information about the Zope3-Checkins
mailing list