[Zope3-checkins] CVS: Zope3/src/zope/app/workflow/tests - directive_helpers.py:1.3 test_importexport.py:1.3 test_instance.py:1.2
Steve Alexander
steve@cat-box.net
Fri, 6 Jun 2003 15:29:39 -0400
Update of /cvs-repository/Zope3/src/zope/app/workflow/tests
In directory cvs.zope.org:/tmp/cvs-serv7875/src/zope/app/workflow/tests
Modified Files:
directive_helpers.py test_importexport.py test_instance.py
Log Message:
Changed old-style __implements__ to new-style implements()
Also, fixed up some incorrect formatting.
=== Zope3/src/zope/app/workflow/tests/directive_helpers.py 1.2 => 1.3 ===
--- Zope3/src/zope/app/workflow/tests/directive_helpers.py:1.2 Tue Jun 3 18:46:24 2003
+++ Zope3/src/zope/app/workflow/tests/directive_helpers.py Fri Jun 6 15:29:08 2003
@@ -17,7 +17,7 @@
from zope.app.interfaces.workflow import IProcessDefinition
from zope.app.interfaces.workflow import IProcessDefinitionImportHandler
from zope.app.interfaces.workflow import IProcessDefinitionExportHandler
-
+from zope.interface import implements
class ITestProcessDefinitionA(IProcessDefinition):
@@ -29,7 +29,7 @@
class TestImportHandlerA:
- __implements__ = IProcessDefinitionImportHandler
+ implements(IProcessDefinitionImportHandler)
def canImport(self, context, data):
return bool(data.read() == 'A')
@@ -40,7 +40,7 @@
class TestImportHandlerB:
- __implements__ = IProcessDefinitionImportHandler
+ implements(IProcessDefinitionImportHandler)
def canImport(self, context, data):
return bool(data.read() == 'B')
@@ -49,10 +49,9 @@
return 'Imported B'
-
class TestExportHandlerA:
- __implements__ = IProcessDefinitionExportHandler
+ implements(IProcessDefinitionExportHandler)
def doExport(self, context, process_definition):
return 'Exported A'
@@ -60,7 +59,7 @@
class TestExportHandlerB:
- __implements__ = IProcessDefinitionExportHandler
+ implements(IProcessDefinitionExportHandler)
def doExport(self, context, process_definition):
return 'Exported B'
=== Zope3/src/zope/app/workflow/tests/test_importexport.py 1.2 => 1.3 ===
--- Zope3/src/zope/app/workflow/tests/test_importexport.py:1.2 Tue Jun 3 18:46:24 2003
+++ Zope3/src/zope/app/workflow/tests/test_importexport.py Fri Jun 6 15:29:08 2003
@@ -19,18 +19,18 @@
from zope.app.workflow import globalimportexport
from zope.app.workflow.tests import directive_helpers
+from zope.interface import implements
+
gIE = globalimportexport.globalImportExport
dh = directive_helpers
class PDA:
- __implements__ = dh.ITestProcessDefinitionA
+ implements(dh.ITestProcessDefinitionA)
class PDB:
- __implements__ = dh.ITestProcessDefinitionB
-
-
+ implements(dh.ITestProcessDefinitionB)
class Test(PlacelessSetup, unittest.TestCase):
@@ -60,9 +60,7 @@
'Exported A')
self.assertEqual(gIE.exportProcessDefinition(None, PDB()),
'Exported B')
-
-
def test_suite():
loader=unittest.TestLoader()
=== Zope3/src/zope/app/workflow/tests/test_instance.py 1.1 => 1.2 ===
--- Zope3/src/zope/app/workflow/tests/test_instance.py:1.1 Thu May 8 13:27:20 2003
+++ Zope3/src/zope/app/workflow/tests/test_instance.py Fri Jun 6 15:29:08 2003
@@ -23,10 +23,11 @@
from zope.app.interfaces.workflow import IProcessInstanceContainer
from zope.app.workflow.instance import ProcessInstanceContainerAdapter, WFKey
+from zope.interface import implements
class TestAnnotations(dict):
- __implements__ = IAnnotations
+ implements(IAnnotations)
class DummyInstance:
pass
@@ -38,7 +39,6 @@
verifyClass(IProcessInstance, ProcessInstance)
-
class ProcessInstanceContainerAdapterTests(PlacelessSetup, unittest.TestCase):
def testInterface(self):
@@ -58,7 +58,7 @@
self.assertEqual(pica.values(), [])
self.assertEqual(pica.get('nothing', 1), 1)
self.assertRaises(TypeError, pica.setObject, 123, None)
-
+
pica.setObject('dummy', di)
self.assertEqual(len(pica), 1)
self.assertEqual(pica.keys(), ['dummy'])
@@ -72,11 +72,6 @@
self.assertEqual(len(pica), 0)
self.failIf('dummy' in pica)
-
-
-
-
-
def test_suite():