cybertools/agent/tests.py
scrat 5aee688a12 check-in. At the moment problem with doctests for README.txt in cybertools/agent and cybertools/agent/crawl.Outlook.txt
Problem Nr. 1 in /agent/README.txt:
    master.config
Expected:
    controller.names = ['base.sample']
    logger.name = 'default'
    logger.standard = 30
    scheduler.name = 'sample'
Got:
    logger.name = 'default'
    logger.standard = 30
    scheduler.name = 'sample'


Problem Nr. 2 in /agent/crawl/Outlook.txt:
self.agent.setupAgents(self, [spec])
File "[..]\cybertools\agent\base\agent.py", line 85, in setupAgents
        agent.name = spec.name
    AttributeError: 'NoneType' object has no attribute 'name'


git-svn-id: svn://svn.cy55.de/Zope3/src/cybertools/trunk@2499 fd906abe-77d9-0310-91a1-e0d9ade77398
2008-04-06 17:28:30 +00:00

52 lines
1.2 KiB
Python
Executable file

#! /usr/bin/env python
# $Id$
import os, time
import unittest, doctest
from zope.testing.doctestunit import DocFileSuite
from twisted.internet import reactor
#from twisted.internet.defer import Deferred
#from twisted.trial import unittest as trial_unittest
baseDir = os.path.dirname(__file__)
class Tester(object):
""" Used for controlled execution of reactor iteration cycles.
"""
def iterate(self, n=10, delays={}):
for i in range(n):
delay = delays.get(i, 0)
reactor.iterate(delay)
tester = Tester()
class Test(unittest.TestCase):
"Basic tests for the cybertools.agent package."
def setUp(self):
pass
def tearDown(self):
pass
def testBasicStuff(self):
pass
def test_suite():
flags = doctest.NORMALIZE_WHITESPACE | doctest.ELLIPSIS
testSuite = unittest.TestSuite((
unittest.makeSuite(Test),
DocFileSuite('README.txt', optionflags=flags),
DocFileSuite('crawl/README.txt', optionflags=flags),
DocFileSuite('crawl/Outlook.txt', optionflags=flags),
))
return testSuite
if __name__ == '__main__':
standard_unittest.main(defaultTest='test_suite')