summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 5ef76a0)
raw | patch | inline | side by side (parent: 5ef76a0)
author | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Wed, 15 May 2002 03:27:16 +0000 (03:27 +0000) | ||
committer | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Wed, 15 May 2002 03:27:16 +0000 (03:27 +0000) |
(thanks dman)
. fixed some sorting issues that were breaking some unit tests under py2.2
. mailgw test output dir was confusing the init test (but only on 2.2 *shrug*)
fixed bug in the init unit test that meant only the bsddb test ran if it
could (it clobbered the anydbm test)
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@731 57a73879-2fb5-44c3-a270-3262357dd7e2
. fixed some sorting issues that were breaking some unit tests under py2.2
. mailgw test output dir was confusing the init test (but only on 2.2 *shrug*)
fixed bug in the init unit test that meant only the bsddb test ran if it
could (it clobbered the anydbm test)
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@731 57a73879-2fb5-44c3-a270-3262357dd7e2
CHANGES.txt | patch | blob | history | |
roundup/roundupdb.py | patch | blob | history | |
test/test_init.py | patch | blob | history | |
test/test_mailgw.py | patch | blob | history |
diff --git a/CHANGES.txt b/CHANGES.txt
index 4ffa5fb7b23c646c30dd665bde22d1e538ed4b6a..ddfb7c8d0c03e2074b23ee5a25651190ac743cdc 100644 (file)
--- a/CHANGES.txt
+++ b/CHANGES.txt
. file upload broke if you didn't supply a change note
. fixed SCRIPT_NAME in ZRoundup for instances not at top level of Zope
(thanks dman)
+ . fixed some sorting issues that were breaking some unit tests under py2.2
+ . mailgw test output dir was confusing the init test (but only on 2.2 *shrug*)
2002-03-25 - 0.4.1
diff --git a/roundup/roundupdb.py b/roundup/roundupdb.py
index d126456466f25df992d1a9253687bd7fc16a5caa..f870bb99a0e4b75e60accffc5d66b1dfdebaf2f5 100644 (file)
--- a/roundup/roundupdb.py
+++ b/roundup/roundupdb.py
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
#
-# $Id: roundupdb.py,v 1.51 2002-04-08 03:46:42 richard Exp $
+# $Id: roundupdb.py,v 1.52 2002-05-15 03:27:16 richard Exp $
__doc__ = """
Extending hyperdb with types specific to issue-tracking.
# get the files for this message
message_files = messages.get(msgid, 'files')
+ # make sure the To line is always the same (for testing mostly)
+ sendto.sort()
+
# create the message
message = cStringIO.StringIO()
writer = MimeWriter.MimeWriter(message)
# now try to send the message
if SENDMAILDEBUG:
open(SENDMAILDEBUG, 'w').write('FROM: %s\nTO: %s\n%s\n'%(
- self.db.config.ADMIN_EMAIL,', '.join(sendto),message.getvalue()))
+ self.db.config.ADMIN_EMAIL,
+ ', '.join(sendto),message.getvalue()))
else:
try:
# send the message as admin so bounces are sent there
key = link.labelprop(default_to_id=1)
if key:
value = [link.get(entry, key) for entry in value]
+ value.sort()
value = ', '.join(value)
m.append('%s: %s'%(propname, value))
m.insert(0, '----------')
#
# $Log: not supported by cvs2svn $
+# Revision 1.51 2002/04/08 03:46:42 richard
+# make it work
+#
# Revision 1.50 2002/04/08 03:40:31 richard
# . added a "detectors" directory for people to put their useful auditors and
# reactors in. Note - the roundupdb.IssueClass.sendmessage method has been
diff --git a/test/test_init.py b/test/test_init.py
index 74017ba8d200f304282898ad5cb122918183ea50..b21a5ff8561a03c99a343bb427f805122c5532f6 100644 (file)
--- a/test/test_init.py
+++ b/test/test_init.py
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
#
-# $Id: test_init.py,v 1.7 2001-10-28 22:51:38 richard Exp $
+# $Id: test_init.py,v 1.8 2002-05-15 03:27:16 richard Exp $
import unittest, os, shutil, errno, imp, sys
count = 0
def setUp(self):
MyTestCase.count = MyTestCase.count + 1
- self.dirname = '_test_%s'%self.count
+ self.dirname = '_test_init_%s'%self.count
try:
shutil.rmtree(self.dirname)
except OSError, error:
l = db.timelog.list()
ae(l, [])
+class bsddbClassicTestCase(ClassicTestCase):
+ backend = 'bsddb'
+class bsddbExtendedTestCase(ExtendedTestCase):
+ backend = 'bsddb'
+
+class bsddb3ClassicTestCase(ClassicTestCase):
+ backend = 'bsddb3'
+class bsddb3ExtendedTestCase(ExtendedTestCase):
+ backend = 'bsddb3'
+
def suite():
l = [unittest.makeSuite(ClassicTestCase, 'test'),
unittest.makeSuite(ExtendedTestCase, 'test')]
try:
import bsddb
- x = ClassicTestCase
- x.backend = 'bsddb'
- l.append(unittest.makeSuite(x, 'test'))
- x = ExtendedTestCase
- x.backend = 'bsddb'
- l.append(unittest.makeSuite(x, 'test'))
+ l.append(unittest.makeSuite(bsddbClassicTestCase, 'test'))
+ l.append(unittest.makeSuite(bsddbExtendedTestCase, 'test'))
except:
print 'bsddb module not found, skipping bsddb DBTestCase'
# try:
# import bsddb3
-# x = ClassicTestCase
-# x.backend = 'bsddb3'
-# l.append(unittest.makeSuite(x, 'test'))
-# x = ExtendedTestCase
-# x.backend = 'bsddb3'
-# l.append(unittest.makeSuite(x, 'test'))
+# l.append(unittest.makeSuite(bsddb3ClassicTestCase, 'test'))
+# l.append(unittest.makeSuite(bsddb3ExtendedTestCase, 'test'))
# except:
# print 'bsddb3 module not found, skipping bsddb3 DBTestCase'
#
# $Log: not supported by cvs2svn $
+# Revision 1.7 2001/10/28 22:51:38 richard
+# Fixed ENOENT/WindowsError thing, thanks Juergen Hermann
+#
# Revision 1.6 2001/09/29 23:48:06 richard
# Bug fix for test_init on Windows.
# More documenation!!
diff --git a/test/test_mailgw.py b/test/test_mailgw.py
index 1c50d99540765aa155d922fbfbd01a42192a4f08..956bc5fe9691b06857e8c46c7467b4477a28871d 100644 (file)
--- a/test/test_mailgw.py
+++ b/test/test_mailgw.py
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#
-# $Id: test_mailgw.py,v 1.17 2002-05-02 07:56:34 richard Exp $
+# $Id: test_mailgw.py,v 1.18 2002-05-15 03:27:16 richard Exp $
import unittest, cStringIO, tempfile, os, shutil, errno, imp, sys, difflib
'''
if s1 == s2:
return
- # under python2.1 we allow a difference of one trailing empty line.
+
+ # under python2.[12] we allow a difference of one trailing empty line.
if sys.version_info[0:2] == (2,1):
if s1+'\n' == s2:
return
+ if sys.version_info[0:2] == (2,2):
+ if s1 == s2+'\n':
+ return
l1=s1.split('\n')
l2=s2.split('\n')
schema = 'classic'
def setUp(self):
MailgwTestCase.count = MailgwTestCase.count + 1
- self.dirname = '_test_%s'%self.count
+ self.dirname = '_test_mailgw_%s'%self.count
try:
shutil.rmtree(self.dirname)
except OSError, error:
if os.path.exists(os.environ['SENDMAILDEBUG']):
error = open(os.environ['SENDMAILDEBUG']).read()
self.assertEqual('no error', error)
- self.assertEqual(self.db.issue.get(nodeid, 'nosy'), ['2', '3'])
+ l = self.db.issue.get(nodeid, 'nosy')
+ l.sort()
+ self.assertEqual(l, ['2', '3'])
def testNewIssueNosy(self):
self.instance.ADD_AUTHOR_TO_NOSY = 'yes'
if os.path.exists(os.environ['SENDMAILDEBUG']):
error = open(os.environ['SENDMAILDEBUG']).read()
self.assertEqual('no error', error)
- self.assertEqual(self.db.issue.get(nodeid, 'nosy'), ['2', '3'])
+ l = self.db.issue.get(nodeid, 'nosy')
+ l.sort()
+ self.assertEqual(l, ['2', '3'])
def testAlternateAddress(self):
message = cStringIO.StringIO('''Content-Type: text/plain;
----------
assignedto: richard
messages: 1
-nosy: mary, Chef, richard
+nosy: Chef, mary, richard
status: unread
title: Testing...
___________________________________________________
self.compareStrings(open(os.environ['SENDMAILDEBUG']).read(),
'''FROM: roundup-admin@fill.me.in.
-TO: chef@bork.bork.bork, mary@test, john@test
+TO: chef@bork.bork.bork, john@test, mary@test
Content-Type: text/plain
Subject: [issue1] Testing...
-To: chef@bork.bork.bork, mary@test, john@test
+To: chef@bork.bork.bork, john@test, mary@test
From: richard <issue_tracker@fill.me.in.>
Reply-To: Roundup issue tracker <issue_tracker@fill.me.in.>
MIME-Version: 1.0
self.compareStrings(open(os.environ['SENDMAILDEBUG']).read(),
'''FROM: roundup-admin@fill.me.in.
-TO: chef@bork.bork.bork, mary@test, john@test
+TO: chef@bork.bork.bork, john@test, mary@test
Content-Type: text/plain
Subject: [issue1] Testing...
-To: chef@bork.bork.bork, mary@test, john@test
+To: chef@bork.bork.bork, john@test, mary@test
From: richard <issue_tracker@fill.me.in.>
Reply-To: Roundup issue tracker <issue_tracker@fill.me.in.>
MIME-Version: 1.0
self.compareStrings(open(os.environ['SENDMAILDEBUG']).read(),
'''FROM: roundup-admin@fill.me.in.
-TO: john@test, chef@bork.bork.bork, richard@test
+TO: chef@bork.bork.bork, john@test, richard@test
Content-Type: text/plain
Subject: [issue1] Testing...
-To: john@test, chef@bork.bork.bork, richard@test
+To: chef@bork.bork.bork, john@test, richard@test
From: john <issue_tracker@fill.me.in.>
Reply-To: Roundup issue tracker <issue_tracker@fill.me.in.>
MIME-Version: 1.0
#
# $Log: not supported by cvs2svn $
+# Revision 1.17 2002/05/02 07:56:34 richard
+# . added option to automatically add the authors and recipients of messages
+# to the nosy lists with the options ADD_AUTHOR_TO_NOSY (default 'new') and
+# ADD_RECIPIENTS_TO_NOSY (default 'new'). These settings emulate the current
+# behaviour. Setting them to 'yes' will add the author/recipients to the nosy
+# on messages that create issues and followup messages.
+# . added missing documentation for a few of the config option values
+#
# Revision 1.16 2002/03/19 21:58:11 grubert
# . for python2.1 test_mailgw compareString allows an extra trailing empty line (for quopri.
#