[Zope-CVS] CVS: Packages/TestScripts - autotester.py:1.18
Chris Withers
chrisw@nipltd.com
Wed, 27 Nov 2002 13:32:47 -0500
Update of /cvs-repository/Packages/TestScripts
In directory cvs.zope.org:/tmp/cvs-serv13059/TestScripts
Modified Files:
autotester.py
Log Message:
Patch to make autotester more pedantic about sending out 'OK :-)' messages. Thanks to Godefroid Chapelle for the patch.
=== Packages/TestScripts/autotester.py 1.17 => 1.18 ===
--- Packages/TestScripts/autotester.py:1.17 Wed Nov 27 13:30:26 2002
+++ Packages/TestScripts/autotester.py Wed Nov 27 13:32:47 2002
@@ -11,7 +11,7 @@
from xml2dict import xml2dict
from StringIO import StringIO
from threading import Thread
-from re import compile, I
+from re import compile, I, M
class NonBlockingReader(Thread):
@@ -156,6 +156,7 @@
# send the mail
failed_re = compile('FAILED \((?:failures=(\d+))?(?:, )?(?:errors=(\d+))?')
other_errors_re = compile('error|warning',I)
+ success_re = compile('^OK$', M)
for address,body,name in emails:
subject = email['subject'][0]()+ ' - ' + name + ' - '
content = body.getvalue()
@@ -182,8 +183,10 @@
pass
elif other_errors_re.findall(content):
subject += ' Not OK :-('
- else:
+ elif success_re.findall(content):
subject += ' OK :-)'
+ else:
+ subject += ' Not OK :-('
send(address,
subject,