[Zope3-checkins] CVS: Zope3/src/zope/component/tests -
test_factory.py:1.5
Jim Fulton
jim at zope.com
Sun Apr 11 14:16:56 EDT 2004
Update of /cvs-repository/Zope3/src/zope/component/tests
In directory cvs.zope.org:/tmp/cvs-serv19402/src/zope/component/tests
Modified Files:
test_factory.py
Log Message:
Got rid of the module global utilityService. Now you must go through
getService to get the global utility service.
getFactoriesFor now returns an iteratable
=== Zope3/src/zope/component/tests/test_factory.py 1.4 => 1.5 ===
--- Zope3/src/zope/component/tests/test_factory.py:1.4 Tue Mar 9 19:58:45 2004
+++ Zope3/src/zope/component/tests/test_factory.py Sun Apr 11 14:16:56 2004
@@ -20,8 +20,8 @@
from zope.interface.interfaces import IDeclaration
from zope.component import createObject, getFactoryInterfaces, getFactoriesFor
+from zope.component import getService, servicenames
from zope.component.interfaces import IFactory
-from zope.component.utility import utilityService
from zope.component.factory import Factory
from placelesssetup import PlacelessSetup
@@ -66,6 +66,7 @@
def setUp(self):
super(TestFactoryZAPIFunctions, self).setUp()
self.factory = Factory(Klass, 'Klass', 'Klassier')
+ utilityService = getService(None, servicenames.Utilities)
utilityService.provideUtility(IFactory, self.factory, 'klass')
def testCreateObject(self):
@@ -80,7 +81,7 @@
self.assertEqual([iface for iface in implemented], [IKlass])
def testGetFactoriesFor(self):
- self.assertEqual(getFactoriesFor(None, IKlass),
+ self.assertEqual(list(getFactoriesFor(None, IKlass)),
[('klass', self.factory)])
More information about the Zope3-Checkins
mailing list