[Zope3-checkins] CVS: Zope3/src/zope/app/workflow/tests - test_service.py:1.6

Jim Fulton jim at zope.com
Sun Sep 21 13:34:04 EDT 2003


Update of /cvs-repository/Zope3/src/zope/app/workflow/tests
In directory cvs.zope.org:/tmp/cvs-serv15824/src/zope/app/workflow/tests

Modified Files:
	test_service.py 
Log Message:
Changed to use __setitem__ rather than setObject

Use helper function to add registrations.


=== Zope3/src/zope/app/workflow/tests/test_service.py 1.5 => 1.6 ===
--- Zope3/src/zope/app/workflow/tests/test_service.py:1.5	Sat Jun 21 17:22:17 2003
+++ Zope3/src/zope/app/workflow/tests/test_service.py	Sun Sep 21 13:34:03 2003
@@ -66,35 +66,43 @@
     def setUp(self):
         WorkflowSetup.setUp(self)
         # setup ProcessDefinitions
-        self.default.setObject('pd1', DummyProcessDefinition(1))
-        self.default.setObject('pd2', DummyProcessDefinition(2))
+        self.default['pd1'] = DummyProcessDefinition(1)
+        self.default['pd2'] = DummyProcessDefinition(2)
 
-        self.cm.setObject('', ProcessDefinitionRegistration('definition1',
-                                '/++etc++site/default/pd1'))
+        n = self.cm.addRegistration(
+            ProcessDefinitionRegistration('definition1',
+                                          '/++etc++site/default/pd1'))
         zapi.traverse(self.default.getRegistrationManager(),
-                      '2').status = ActiveStatus
-        self.cm.setObject('', ProcessDefinitionRegistration('definition2',
-                                '/++etc++site/default/pd2'))
+                      n).status = ActiveStatus
+        n = self.cm.addRegistration(
+            ProcessDefinitionRegistration('definition2',
+                                          '/++etc++site/default/pd2'))
         zapi.traverse(self.default.getRegistrationManager(),
-                      '3').status = ActiveStatus
-        self.cm.setObject('', ProcessDefinitionRegistration('definition3',
-                                '/++etc++site/default/pd1'))
+                      n).status = ActiveStatus
+        n = self.cm.addRegistration(
+            ProcessDefinitionRegistration('definition3',
+                                              '/++etc++site/default/pd1'))
         zapi.traverse(self.default.getRegistrationManager(),
-                 '4').status = RegisteredStatus
+                 n).status = RegisteredStatus
+
         # Now self.service has definition1 and definition2 available
         # and knows about definition3
 
-        self.default1.setObject('pd3', DummyProcessDefinition(3))
-        self.default1.setObject('pd4', DummyProcessDefinition(4))
+        self.default1['pd3'] = DummyProcessDefinition(3)
+        self.default1['pd4'] = DummyProcessDefinition(4)
 
-        self.cm1.setObject('', ProcessDefinitionRegistration('definition1',
-                            '/folder1/++etc++site/default/pd3'))
+        n = self.cm1.addRegistration(
+            ProcessDefinitionRegistration(
+                'definition1',
+                '/folder1/++etc++site/default/pd3'))
         zapi.traverse(self.default1.getRegistrationManager(),
-                      '2').status = ActiveStatus
-        self.cm1.setObject('', ProcessDefinitionRegistration('definition4',
-                            '/folder1/++etc++site/default/pd4'))
+                      n).status = ActiveStatus
+        n = self.cm1.addRegistration(
+            ProcessDefinitionRegistration(
+                     'definition4',
+                     '/folder1/++etc++site/default/pd4'))
         zapi.traverse(self.default1.getRegistrationManager(),
-                      '3').status = ActiveStatus
+                      n).status = ActiveStatus
         # Now self.service1 overrides definition1, adds new definition4
         # available, and inherits definition2 from self.service
 




More information about the Zope3-Checkins mailing list