[Zope3-checkins] CVS: Zope3/src/zope/app/workflow/stateful/tests -
test_contentworkflow.py:1.7.6.1 test_definition.py:1.2.24.1
test_instance.py:1.8.10.3
Jim Fulton
jim at zope.com
Fri Sep 12 15:16:11 EDT 2003
Update of /cvs-repository/Zope3/src/zope/app/workflow/stateful/tests
In directory cvs.zope.org:/tmp/cvs-serv13470/src/zope/app/workflow/stateful/tests
Modified Files:
Tag: parentgeddon-branch
test_contentworkflow.py test_definition.py test_instance.py
Log Message:
Can't have the tests passing, can we?
=== Zope3/src/zope/app/workflow/stateful/tests/test_contentworkflow.py 1.7 => 1.7.6.1 ===
--- Zope3/src/zope/app/workflow/stateful/tests/test_contentworkflow.py:1.7 Sun Aug 17 02:08:41 2003
+++ Zope3/src/zope/app/workflow/stateful/tests/test_contentworkflow.py Fri Sep 12 15:15:40 2003
@@ -84,7 +84,7 @@
def getManager(self):
manager = ContentWorkflowsManager()
manager._registry = {IFace1: ('default',), IFace2: ('default',)}
- self.default.setObject('manager', manager)
+ self.default['manager'] = manager
return zapi.traverse(self.default, 'manager')
def test_subscribe(self):
@@ -159,15 +159,17 @@
def test_notify(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)
- id = self.cm.setObject('', ProcessDefinitionRegistration('definition1',
- '/++etc++site/default/pd1'))
+ id = self.cm.addRegistration(
+ ProcessDefinitionRegistration('definition1',
+ '/++etc++site/default/pd1'))
zapi.traverse(self.default.getRegistrationManager(),
id).status = ActiveStatus
- id = self.cm.setObject('', ProcessDefinitionRegistration('definition2',
- '/++etc++site/default/pd2'))
+ id = self.cm.addRegistration(
+ ProcessDefinitionRegistration('definition2',
+ '/++etc++site/default/pd2'))
zapi.traverse(self.default.getRegistrationManager(),
id).status = ActiveStatus
manager = self.getManager()
=== Zope3/src/zope/app/workflow/stateful/tests/test_definition.py 1.2 => 1.2.24.1 ===
--- Zope3/src/zope/app/workflow/stateful/tests/test_definition.py:1.2 Fri Jun 6 15:29:07 2003
+++ Zope3/src/zope/app/workflow/stateful/tests/test_definition.py Fri Sep 12 15:15:40 2003
@@ -143,13 +143,13 @@
pd = self.pd
self.st1 = st1 = DummyState()
self.st2 = st2 = DummyState()
- pd.states.setObject('st1', st1)
- pd.states.setObject('st2', st2)
+ pd.states['st1'] = st1
+ pd.states['st2'] = st2
self.tr1 = tr1 = DummyTransition()
self.tr2 = tr2 = DummyTransition()
- pd.transitions.setObject('tr1', tr1)
- pd.transitions.setObject('tr2', tr2)
+ pd.transitions['tr1'] = tr1
+ pd.transitions['tr2'] = tr2
def testInterface(self):
verifyClass(IStatefulProcessDefinition, StatefulProcessDefinition)
=== Zope3/src/zope/app/workflow/stateful/tests/test_instance.py 1.8.10.2 => 1.8.10.3 ===
--- Zope3/src/zope/app/workflow/stateful/tests/test_instance.py:1.8.10.2 Tue Sep 9 14:08:22 2003
+++ Zope3/src/zope/app/workflow/stateful/tests/test_instance.py Fri Sep 12 15:15:40 2003
@@ -83,27 +83,21 @@
pd.setRelevantDataSchema(ITestDataSchema)
- pd.states.setObject('private', State())
- pd.states.setObject('published', State())
- pd.states.setObject('pending', State())
-
- pd.transitions.setObject('show',
- Transition('INITIAL', 'private'))
- pd.transitions.setObject('publish_direct',
- Transition('private', 'published'))
- pd.transitions.setObject('publish_pending',
- Transition('pending', 'published'))
- pd.transitions.setObject('submit_pending',
- Transition('private', 'pending'))
- pd.transitions.setObject('retract_published',
- Transition('published', 'private'))
- pd.transitions.setObject('retract_pending',
- Transition('pending', 'private'))
+ pd.states['private'] = State()
+ pd.states['published'] = State()
+ pd.states['pending'] = State()
+
+ pd.transitions['show'] = Transition('INITIAL', 'private')
+ pd.transitions['publish_direct'] = Transition('private', 'published')
+ pd.transitions['publish_pending'] = Transition('pending', 'published')
+ pd.transitions['submit_pending'] = Transition('private', 'pending')
+ pd.transitions['retract_published'] = Transition(
+ 'published', 'private')
+ pd.transitions['retract_pending'] = Transition('pending', 'private')
- self.default.setObject('pd1', pd )
+ self.default['pd1'] = pd
- name = self.cm.setObject(
- '',
+ name = self.cm.addRegistration(
ProcessDefinitionRegistration('definition1',
'/++etc++site/default/pd1'))
zapi.traverse(self.default.getRegistrationManager(),
@@ -199,33 +193,25 @@
pd.setRelevantDataSchema(ITestDataSchema)
- pd.states.setObject('state1', State())
- pd.states.setObject('state2', State())
+ pd.states['state1'] = State()
+ pd.states['state2'] = State()
- pd.transitions.setObject('initial_state1',
- Transition('INITIAL', 'state1',
- condition='data/value'))
- pd.transitions.setObject('initial_state2',
- Transition('INITIAL', 'state2',
- condition='not: data/value'))
- pd.transitions.setObject(
- 'state1_state2',
- Transition('state1', 'state2',
- condition='python: data.text == "some text"'))
- pd.transitions.setObject(
- 'state2_state1',
- Transition('state2', 'state1',
- condition='python: data.text == "no text"'))
- pd.transitions.setObject('state1_initial',
- Transition('state1', 'INITIAL'))
- pd.transitions.setObject('state2_initial',
- Transition('state2', 'INITIAL'))
-
- self.default.setObject('pd1', pd )
-
- n = self.cm.setObject(
- '', ProcessDefinitionRegistration('definition1',
- '/++etc++site/default/pd1'))
+ pd.transitions['initial_state1'] = Transition(
+ 'INITIAL', 'state1', condition='data/value')
+ pd.transitions['initial_state2'] = Transition(
+ 'INITIAL', 'state2', condition='not: data/value')
+ pd.transitions['state1_state2'] = Transition(
+ 'state1', 'state2', condition='python: data.text == "some text"')
+ pd.transitions['state2_state1'] = Transition(
+ 'state2', 'state1', condition='python: data.text == "no text"')
+ pd.transitions['state1_initial'] = Transition('state1', 'INITIAL')
+ pd.transitions['state2_initial'] = Transition('state2', 'INITIAL')
+
+ self.default['pd1'] = pd
+
+ n = self.cm.addRegistration(
+ ProcessDefinitionRegistration('definition1',
+ '/++etc++site/default/pd1'))
zapi.traverse(self.default.getRegistrationManager(), n
).status = ActiveStatus
@@ -293,31 +279,25 @@
pd.setRelevantDataSchema(ITestDataSchema)
- pd.states.setObject('state1', State())
- pd.states.setObject('state2', State())
+ pd.states['state1'] = State()
+ pd.states['state2'] = State()
- pd.transitions.setObject('initial_state1',
- Transition('INITIAL', 'state1',
- script=lambda c: c['data'].value))
- pd.transitions.setObject(
- 'initial_state2',
- Transition('INITIAL', 'state2',
- script=lambda c: not c['data'].value))
- pd.transitions.setObject('state1_state2',
- Transition('state1', 'state2',
- script=transition_script1))
- pd.transitions.setObject('state2_state1',
- Transition('state2', 'state1',
- script=transition_script2))
- pd.transitions.setObject('state1_initial',
- Transition('state1', 'INITIAL'))
- pd.transitions.setObject('state2_initial',
- Transition('state2', 'INITIAL'))
+ pd.transitions['initial_state1'] = Transition(
+ 'INITIAL', 'state1', script=lambda c: c['data'].value)
+ pd.transitions['initial_state2'] = Transition(
+ 'INITIAL', 'state2', script=lambda c: not c['data'].value)
+ pd.transitions['state1_state2'] = Transition(
+ 'state1', 'state2', script=transition_script1)
+ pd.transitions['state2_state1'] = Transition(
+ 'state2', 'state1', script=transition_script2)
+ pd.transitions['state1_initial'] = Transition('state1', 'INITIAL')
+ pd.transitions['state2_initial'] = Transition('state2', 'INITIAL')
- self.default.setObject('pd1', pd )
+ self.default['pd1'] = pd
- k = self.cm.setObject('', ProcessDefinitionRegistration('definition1',
- '/++etc++site/default/pd1'))
+ k = self.cm.addRegistration(
+ ProcessDefinitionRegistration('definition1',
+ '/++etc++site/default/pd1'))
zapi.traverse(self.default.getRegistrationManager(),
k).status = ActiveStatus
@@ -386,31 +366,26 @@
pd.setRelevantDataSchema(ITestDataSchema)
- pd.states.setObject('state1', State())
- pd.states.setObject('state2', State())
+ pd.states['state1'] = State()
+ pd.states['state2'] = State()
- pd.transitions.setObject('initial_state1',
- Transition('INITIAL', 'state1',
- permission=CheckerPublic))
- pd.transitions.setObject('initial_state2',
- Transition('INITIAL', 'state2',
- permission='deny'))
- pd.transitions.setObject('state1_state2',
- Transition('state1', 'state2',
- permission=CheckerPublic))
- pd.transitions.setObject('state2_state1',
- Transition('state2', 'state1'))
- pd.transitions.setObject('state1_initial',
- Transition('state1', 'INITIAL',
- permission='deny'))
- pd.transitions.setObject('state2_initial',
- Transition('state2', 'INITIAL',
- permission=CheckerPublic))
+ pd.transitions['initial_state1'] = Transition(
+ 'INITIAL', 'state1', permission=CheckerPublic)
+ pd.transitions['initial_state2'] = Transition(
+ 'INITIAL', 'state2', permission='deny')
+ pd.transitions['state1_state2'] = Transition(
+ 'state1', 'state2', permission=CheckerPublic)
+ pd.transitions['state2_state1'] = Transition('state2', 'state1')
+ pd.transitions['state1_initial'] = Transition(
+ 'state1', 'INITIAL', permission='deny')
+ pd.transitions['state2_initial'] = Transition(
+ 'state2', 'INITIAL', permission=CheckerPublic)
- self.default.setObject('pd1', pd )
+ self.default['pd1'] = pd
- k = self.cm.setObject('', ProcessDefinitionRegistration('definition1',
- '/++etc++site/default/pd1'))
+ k = self.cm.addRegistration(
+ ProcessDefinitionRegistration('definition1',
+ '/++etc++site/default/pd1'))
zapi.traverse(self.default.getRegistrationManager(),
k).status = ActiveStatus
More information about the Zope3-Checkins
mailing list