Skip to content

Commit 2753a8b

Browse files
author
Richard Jones
committed
fix some unit tests for python2.3
1 parent 87b0d45 commit 2753a8b

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

test/db_test_base.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1616
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1717
#
18-
# $Id: db_test_base.py,v 1.100 2008-08-19 00:52:01 richard Exp $
18+
# $Id: db_test_base.py,v 1.101 2008-08-19 01:40:59 richard Exp $
1919

2020
import unittest, os, shutil, errno, imp, sys, time, pprint, sets, base64, os.path
2121

@@ -280,7 +280,7 @@ def testMultilinkChangeIterable(self):
280280
# try a couple of the built-in iterable types to make
281281
# sure that we accept them and handle them properly
282282
# try a set as input for the multilink
283-
nid = self.db.issue.create(title="spam", nosy=set(u1))
283+
nid = self.db.issue.create(title="spam", nosy=sets.Set(u1))
284284
if commit: self.db.commit()
285285
self.assertEqual(self.db.issue.get(nid, "nosy"), [u1])
286286
self.assertRaises(TypeError, self.db.issue.set, nid,
@@ -290,7 +290,7 @@ def testMultilinkChangeIterable(self):
290290
if commit: self.db.commit()
291291
self.assertEqual(self.db.issue.get(nid, "nosy"), [])
292292
# make sure we accept a frozen set
293-
self.db.issue.set(nid, nosy=frozenset([u1,u2]))
293+
self.db.issue.set(nid, nosy=sets.Set([u1,u2]))
294294
if commit: self.db.commit()
295295
l = [u1,u2]; l.sort()
296296
m = self.db.issue.get(nid, "nosy"); m.sort()
@@ -1794,9 +1794,9 @@ def dummy_snd(s, to, msg, res=res) :
17941794
self.failUnless("New submission from admin" in mail_msg)
17951795
self.failUnless("one two" in mail_msg)
17961796
self.failIf("File 'test1.txt' not attached" in mail_msg)
1797-
self.failUnless(base64.b64encode("xxx") in mail_msg)
1797+
self.failUnless(base64.encodestring("xxx").rstrip() in mail_msg)
17981798
self.failUnless("File 'test2.txt' not attached" in mail_msg)
1799-
self.failIf(base64.b64encode("yyy") in mail_msg)
1799+
self.failIf(base64.encodestring("yyy").rstrip() in mail_msg)
18001800
finally :
18011801
Mailer.smtp_send = backup
18021802

test/test_mailgw.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# but WITHOUT ANY WARRANTY; without even the implied warranty of
99
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
1010
#
11-
# $Id: test_mailgw.py,v 1.95 2008-08-19 01:10:35 richard Exp $
11+
# $Id: test_mailgw.py,v 1.96 2008-08-19 01:40:59 richard Exp $
1212

1313
# TODO: test bcc
1414

@@ -682,7 +682,10 @@ def testFollowupTitleMatchNeverInterval(self):
682682
683683
This is a followup
684684
'''), nodeid)
685-
# now try a longer interval
685+
686+
687+
def testFollowupTitleMatchInterval(self):
688+
nodeid = self.doNewIssue()
686689
self.db.config.MAILGW_SUBJECT_CONTENT_MATCH = 'creation +1d'
687690
self.assertEqual(self._handle_mail('''Content-Type: text/plain;
688691
charset="iso-8859-1"

0 commit comments

Comments
 (0)