[Zope3-checkins]
SVN: Zope3/trunk/src/zope/app/workflow/stateful/tests/test_xmlimportexport.py
Added XML Export test.
Stephan Richter
srichter at cosmos.phy.tufts.edu
Fri Jul 9 11:44:50 EDT 2004
Log message for revision 26296:
Added XML Export test.
-=-
Modified: Zope3/trunk/src/zope/app/workflow/stateful/tests/test_xmlimportexport.py
===================================================================
--- Zope3/trunk/src/zope/app/workflow/stateful/tests/test_xmlimportexport.py 2004-07-09 15:44:48 UTC (rev 26295)
+++ Zope3/trunk/src/zope/app/workflow/stateful/tests/test_xmlimportexport.py 2004-07-09 15:44:50 UTC (rev 26296)
@@ -184,10 +184,50 @@
self.assertEqual(tr.triggerMode, 'Manual')
def testExport(self):
- # XXX TBD before Merge into HEAD !!!!
- pass
+ testpd = TestProcessDefinition()
+ handler = XMLImportHandler(testpd)
+ handler.doImport(xml_text)
+ handler = XMLExportHandler(testpd)
+ xml = handler.doExport()
+ self.assert_(
+ '<?xml version="1.0"?>' in xml)
+ self.assert_(
+ '<workflow type="StatefulWorkflow" title="TestPD">' in xml)
+ self.assert_(
+ '<schema name="zope.app.workflow.stateful.tests.'
+ 'test_xmlimportexport.ISchema">' in xml)
+ self.assert_(
+ '<permission for="title" type="get" id="zope.Public"/>' in xml)
+ self.assert_(
+ '<permission for="title" type="set" id="zope.View"/>' in xml)
+ self.assert_('<state title="State2" name="state2"/>' in xml)
+ self.assert_('<state title="State1" name="state1"/>' in xml)
+ self.assert_('<state title="initial" name="INITIAL"/>' in xml)
+ self.assert_('<transition sourceState="state2"' in xml)
+ self.assert_('destinationState="state1"' in xml)
+ self.assert_('script="some.path.to.some.script"' in xml)
+ self.assert_('permission="zope.View"' in xml)
+ self.assert_('triggerMode="Manual"' in xml)
+ self.assert_('title="State2toINITIAL"' in xml)
+ self.assert_('name="state2_initial"/>' in xml)
+ self.assert_('<transition sourceState="INITIAL"' in xml)
+ self.assert_('destinationState="state1"' in xml)
+ self.assert_('permission="zope.Public"' in xml)
+ self.assert_('triggerMode="Automatic"' in xml)
+ self.assert_('title="INITIALtoState1"' in xml)
+ self.assert_('name="initial_state1"/>' in xml)
+
+ self.assert_('<transition sourceState="state1"' in xml)
+ self.assert_('destinationState="state2"' in xml)
+ self.assert_('condition="python: 1==1"' in xml)
+ self.assert_('permission="zope.Public"' in xml)
+ self.assert_('triggerMode="Manual"' in xml)
+ self.assert_('title="State1toState2"' in xml)
+ self.assert_('name="state1_state2"/>' in xml)
+
+
def test_suite():
return unittest.TestSuite((
unittest.makeSuite(Test),
More information about the Zope3-Checkins
mailing list