[Zope3-checkins] CVS: Packages3/workflow/tests - directive_helpers.py:1.2 test_definition.py:1.4 test_importexport.py:1.2 test_service.py:1.5

Ulrich Eck ueck@net-labs.de
Wed, 9 Apr 2003 14:35:32 -0400


Update of /cvs-repository/Packages3/workflow/tests
In directory cvs.zope.org:/tmp/cvs-serv18601/tests

Modified Files:
	directive_helpers.py test_definition.py test_importexport.py 
	test_service.py 
Log Message:
added a parameter definition_name to createProcessInstance
that eases the implementation alot and avoids some Wrapper-hacks
updated all tests accordingly

added canImport implementation to stateful/xmlimportexport and tests

cleanup a bit


=== Packages3/workflow/tests/directive_helpers.py 1.1 => 1.2 ===
--- Packages3/workflow/tests/directive_helpers.py:1.1	Mon Apr  7 13:33:51 2003
+++ Packages3/workflow/tests/directive_helpers.py	Wed Apr  9 14:35:31 2003
@@ -32,8 +32,8 @@
 
     __implements__ = IProcessDefinitionImportHandler
 
-    def canImport(self, data):
-        return bool(data == 'A')
+    def canImport(self, context, data):
+        return bool(data.read() == 'A')
 
     def doImport(self, context, data):
         return 'Imported A'
@@ -43,8 +43,8 @@
 
     __implements__ = IProcessDefinitionImportHandler
 
-    def canImport(self, data):
-        return bool(data == 'B')
+    def canImport(self, context, data):
+        return bool(data.read() == 'B')
 
     def doImport(self, context, data):
         return 'Imported B'


=== Packages3/workflow/tests/test_definition.py 1.3 => 1.4 ===
--- Packages3/workflow/tests/test_definition.py:1.3	Sat Feb  8 11:57:04 2003
+++ Packages3/workflow/tests/test_definition.py	Wed Apr  9 14:35:31 2003
@@ -31,7 +31,7 @@
 
     def testPDCreation(self):
         pd = ProcessDefinition()
-        pi = pd.createProcessInstance()
+        pi = pd.createProcessInstance(None)
 
 
 


=== Packages3/workflow/tests/test_importexport.py 1.1 => 1.2 ===
--- Packages3/workflow/tests/test_importexport.py:1.1	Mon Apr  7 13:33:51 2003
+++ Packages3/workflow/tests/test_importexport.py	Wed Apr  9 14:35:31 2003
@@ -56,6 +56,8 @@
         self.assertEqual(gIE.importProcessDefinition(None, 'B'),
                          'Imported B')
 
+        self.assertRaises(ValueError, gIE.importProcessDefinition, None, 'C')
+
     def testExportHandler(self):
         self.assertEqual(gIE.exportProcessDefinition(None, PDA()),
                          'Exported A')


=== Packages3/workflow/tests/test_service.py 1.4 => 1.5 ===
--- Packages3/workflow/tests/test_service.py:1.4	Mon Mar 24 09:52:34 2003
+++ Packages3/workflow/tests/test_service.py	Wed Apr  9 14:35:31 2003
@@ -47,7 +47,7 @@
     def __str__(self):
         return'PD #%d' % self.n
     
-    def createProcessInstance(self):
+    def createProcessInstance(self, definition_name):
         return 'PI #%d' % self.n