[Zope3-checkins] CVS: Zope3/src/zope/component/tests - test_service.py:1.3.28.1

Jim Fulton cvs-admin at zope.org
Tue Nov 11 11:04:13 EST 2003


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

Modified Files:
      Tag: adaptergeddon-branch
	test_service.py 
Log Message:
made global service managers picklable (as globals).


=== Zope3/src/zope/component/tests/test_service.py 1.3 => 1.3.28.1 ===
--- Zope3/src/zope/component/tests/test_service.py:1.3	Fri Jun  6 15:29:08 2003
+++ Zope3/src/zope/component/tests/test_service.py	Tue Nov 11 11:04:12 2003
@@ -17,15 +17,16 @@
 """
 
 import unittest
+import pickle
 from zope.interface import Interface, implements
 
+
 from zope.exceptions import DuplicationError
 from zope.testing.cleanup import CleanUp
 
-from zope.component \
-     import getServiceDefinitions, getService, getServiceManager
-from zope.component.service \
-     import UndefinedService, InvalidService
+from zope.component import getServiceDefinitions, getService, getServiceManager
+from zope.component.service import UndefinedService, InvalidService
+from zope.component.service import GlobalServiceManager
 from zope.component.exceptions import ComponentLookupError
 
 from zope.component import queryService
@@ -108,6 +109,16 @@
         defs.sort()
         self.assertEqual(defs,
             [('one', IOne), ('two', ITwo)])
+
+
+    def testPickling(self):
+        self.assertEqual(testServiceManager.__reduce__(), 'testServiceManager')
+        sm = pickle.loads(pickle.dumps(testServiceManager))
+        self.assert_(sm is testServiceManager)
+        
+
+testServiceManager = GlobalServiceManager('testServiceManager', __name__)
+
 
 
 def test_suite():




More information about the Zope3-Checkins mailing list