[Zope3-checkins] CVS: Zope3/src/zope/app/workflow/stateful/tests -
test_xmlimportexport.py:1.11
Jim Fulton
jim at zope.com
Sat Mar 6 11:51:08 EST 2004
Update of /cvs-repository/Zope3/src/zope/app/workflow/stateful/tests
In directory cvs.zope.org:/tmp/cvs-serv11249/src/zope/app/workflow/stateful/tests
Modified Files:
test_xmlimportexport.py
Log Message:
Converted most getAdapter calls to use interface calls instead.
=== Zope3/src/zope/app/workflow/stateful/tests/test_xmlimportexport.py 1.10 => 1.11 ===
--- Zope3/src/zope/app/workflow/stateful/tests/test_xmlimportexport.py:1.10 Mon Mar 1 10:02:55 2004
+++ Zope3/src/zope/app/workflow/stateful/tests/test_xmlimportexport.py Sat Mar 6 11:50:37 2004
@@ -30,7 +30,7 @@
from zope.app.workflow.stateful.xmlimportexport import XMLExportHandler
from zope.app.workflow.stateful.xmlimportexport import XMLImportHandler
from zope.app.tests import ztapi
-from zope.component import getAdapter, getService, getServiceManager
+from zope.component import getService, getServiceManager
from zope.interface import implements, classImplements, Interface
from zope.interface.verify import verifyClass
from zope.schema import TextLine
@@ -131,7 +131,7 @@
handler.doImport(testpd, StringIO(xml_text))
self.assertEqual(testpd.relevantDataSchema, ISchema)
- self.assertEqual(getAdapter(testpd, IZopeDublinCore).title, 'TestPD')
+ self.assertEqual(IZopeDublinCore(testpd).title, 'TestPD')
perm_service = getService(None, Permissions)
self.assertEqual(
@@ -143,20 +143,20 @@
st = testpd.states['INITIAL']
self.assert_(isinstance(st, State))
- self.assertEqual(getAdapter(st, IZopeDublinCore).title, 'initial')
+ self.assertEqual(IZopeDublinCore(st).title, 'initial')
st = testpd.states['state1']
self.assert_(isinstance(st, State))
- self.assertEqual(getAdapter(st, IZopeDublinCore).title, 'State1')
+ self.assertEqual(IZopeDublinCore(st).title, 'State1')
st = testpd.states['state2']
self.assert_(isinstance(st, State))
- self.assertEqual(getAdapter(st, IZopeDublinCore).title, 'State2')
+ self.assertEqual(IZopeDublinCore(st).title, 'State2')
tr = testpd.transitions['initial_state1']
self.assert_(isinstance(tr, Transition))
- self.assertEqual(getAdapter(tr, IZopeDublinCore).title,
+ self.assertEqual(IZopeDublinCore(tr).title,
'INITIALtoState1')
self.assertEqual(tr.sourceState, 'INITIAL')
self.assertEqual(tr.destinationState, 'state1')
@@ -167,7 +167,7 @@
tr = testpd.transitions['state1_state2']
self.assert_(isinstance(tr, Transition))
- self.assertEqual(getAdapter(tr, IZopeDublinCore).title,
+ self.assertEqual(IZopeDublinCore(tr).title,
'State1toState2')
self.assertEqual(tr.sourceState, 'state1')
self.assertEqual(tr.destinationState, 'state2')
@@ -178,7 +178,7 @@
tr = testpd.transitions['state2_initial']
self.assert_(isinstance(tr, Transition))
- self.assertEqual(getAdapter(tr, IZopeDublinCore).title,
+ self.assertEqual(IZopeDublinCore(tr).title,
'State2toINITIAL')
self.assertEqual(tr.sourceState, 'state2')
self.assertEqual(tr.destinationState, 'INITIAL')
More information about the Zope3-Checkins
mailing list