[Zope3-checkins] CVS: Zope3/src/zope/component/tests - test_utilityservice.py:1.11

Stephan Richter srichter at cosmos.phy.tufts.edu
Sat Apr 17 10:33:59 EDT 2004


Update of /cvs-repository/Zope3/src/zope/component/tests
In directory cvs.zope.org:/tmp/cvs-serv17111/src/zope/component/tests

Modified Files:
	test_utilityservice.py 
Log Message:


Get rid of getRegisteredMatching().




=== Zope3/src/zope/component/tests/test_utilityservice.py 1.10 => 1.11 ===
--- Zope3/src/zope/component/tests/test_utilityservice.py:1.10	Sun Apr 11 14:16:43 2004
+++ Zope3/src/zope/component/tests/test_utilityservice.py	Sat Apr 17 10:33:58 2004
@@ -15,7 +15,6 @@
 
 $Id$
 """
-
 from unittest import TestCase, main, makeSuite
 from zope.component import \
      getUtility, getUtilitiesFor, getService, queryUtility, \
@@ -84,31 +83,6 @@
             map(str, us.registrations()),
             ["UtilityRegistration('IDummyUtility', '', 'DummyUtility', '')"])
         
-    def testRegisteredMatching(self):
-        us = getService(None, Utilities)
-        self.assertEqual(queryUtility(None, IDummyUtility), None)
-        self.assertEqual(queryUtility(None, IDummyUtility, self), self)
-        us.provideUtility(IDummyUtility, dummyUtility)
-        self.assertEqual(us.getRegisteredMatching(IDummyUtility),
-                         [(IDummyUtility, '', dummyUtility)])
-
-    def testRegisteredMatchingWithName(self):
-        us = getService(None, Utilities)
-        self.assertEqual(queryUtility(None, IDummyUtility), None)
-        self.assertEqual(queryUtility(None, IDummyUtility, self), self)
-        us.provideUtility(IDummyUtility, dummyUtility, 'dummy')
-        us.provideUtility(IDummyUtility, dummyUtility2, 'another')
-        self.assertEqual(us.getRegisteredMatching(IDummyUtility, 'dummy'),
-                         [(IDummyUtility, 'dummy', dummyUtility)])
-        self.assertEqual(us.getRegisteredMatching(IDummyUtility, 'another'),
-                         [(IDummyUtility, 'another', dummyUtility2)])
-        res = us.getRegisteredMatching(IDummyUtility)
-        res.sort()
-        self.assertEqual(res,
-                         [(IDummyUtility, 'another', dummyUtility2),
-                          (IDummyUtility, 'dummy',   dummyUtility )])
-        self.assertEqual(us.getRegisteredMatching(IDummyUtility, 'stupid'),
-                         [])
 
 def test_suite():
     return makeSuite(Test)




More information about the Zope3-Checkins mailing list