[Zope3-checkins] CVS: Zope3/lib/python/Zope/App/StartUp/tests - testStartupDirectives.py:1.2.12.1
Ulrich Eck
ueck@net-labs.de
Mon, 9 Dec 2002 11:11:26 -0500
Update of /cvs-repository/Zope3/lib/python/Zope/App/StartUp/tests
In directory cvs.zope.org:/tmp/cvs-serv31943/tests
Modified Files:
Tag: jack-e_scheduler_branch
testStartupDirectives.py
Log Message:
TaskSchedule prototype:
SiteDefinition: add Handler for addThread Subdirective
meta.zcml: add Subdirective addThread
tests/testStartupDirectives: add tests for addThread
=== Zope3/lib/python/Zope/App/StartUp/tests/testStartupDirectives.py 1.2 => 1.2.12.1 ===
--- Zope3/lib/python/Zope/App/StartUp/tests/testStartupDirectives.py:1.2 Tue Nov 19 18:25:14 2002
+++ Zope3/lib/python/Zope/App/StartUp/tests/testStartupDirectives.py Mon Dec 9 11:11:25 2002
@@ -21,6 +21,8 @@
from Zope.App.StartUp.metaConfigure import SiteDefinition
from Zope.Configuration.name import resolve
+from Zope.App.StartUp.tests.addThreadCallable import aSimpleCallableTest
+
_fsname = tempfile.mktemp()+'.fs'
class ContextStub:
@@ -116,7 +118,18 @@
connection.close()
self.failUnless(IRootFolder.isImplementedBy(app))
+ def testAddThread(self):
+
+ sd = self._createBlankSiteDefinition()
+
+ callable = 'Zope.App.StartUp.tests.addThreadCallable.aSimpleCallableTest'
+ arglist = 'Some Arguments'
+
+ parsed_arglist = tuple(arglist.split())
+ self.assertEqual(sd.addThread(ContextStub(),callable,arglist), [])
+ self.assertEqual(sd._threads[0], (aSimpleCallableTest, parsed_arglist))
+ self.assertEqual(apply(aSimpleCallableTest, (None, ) + parsed_arglist), (None, 'Some', 'Arguments'))
def test_suite():
loader=unittest.TestLoader()