[Zope3-checkins] SVN: Zope3/branches/jim-index/src/zope/component/ Merged in changes of trunk revisions 25360:25361

Gintautas Miliauskas gintas at pov.lt
Sat Jun 12 04:17:16 EDT 2004


Log message for revision 25373:
Merged in changes of trunk revisions 25360:25361
(the getAllUtilitiesRegisteredFor bugfix).



-=-
Modified: Zope3/branches/jim-index/src/zope/component/tests/test_utilityservice.py
===================================================================
--- Zope3/branches/jim-index/src/zope/component/tests/test_utilityservice.py	2004-06-12 08:13:38 UTC (rev 25372)
+++ Zope3/branches/jim-index/src/zope/component/tests/test_utilityservice.py	2004-06-12 08:17:15 UTC (rev 25373)
@@ -143,8 +143,15 @@
         uts.remove(dummerUtility)
         uts.remove(dummerUtility)
         self.assertEqual(uts, [])
-        
 
+
+    def test_getAllUtilitiesRegisteredFor_empty(self):
+        us = getService(Utilities)
+        class IFoo(Interface):
+            pass
+        self.assertEqual(list(us.getAllUtilitiesRegisteredFor(IFoo)), [])
+
+
 def test_suite():
     return makeSuite(Test)
 

Modified: Zope3/branches/jim-index/src/zope/component/utility.py
===================================================================
--- Zope3/branches/jim-index/src/zope/component/utility.py	2004-06-12 08:13:38 UTC (rev 25372)
+++ Zope3/branches/jim-index/src/zope/component/utility.py	2004-06-12 08:17:15 UTC (rev 25373)
@@ -59,7 +59,7 @@
                 yield item
 
     def getAllUtilitiesRegisteredFor(self, interface):
-        return iter(self._null.get(('s', interface), ()))
+        return iter(self._null.get(('s', interface)) or ())
 
 class GlobalUtilityService(UtilityService, GlobalService):
 




More information about the Zope3-Checkins mailing list