Skip to content

Commit 9667ad9

Browse files
author
Richard Jones
committed
fix mailgw test harness
1 parent 612917a commit 9667ad9

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

test/test_mailgw.py

Lines changed: 6 additions & 3 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.66 2004-03-22 07:45:40 richard Exp $
11+
# $Id: test_mailgw.py,v 1.67 2004-04-09 01:32:58 richard Exp $
1212

1313
import unittest, tempfile, os, shutil, errno, imp, sys, difflib, rfc822
1414

@@ -99,7 +99,7 @@ def setUp(self):
9999
if error.errno not in (errno.ENOENT, errno.ESRCH): raise
100100
# create the instance
101101
init.install(self.dirname, 'templates/classic')
102-
init.write_select_db(self.dirname, 'anydbm')
102+
init.write_select_db(self.dirname, 'sqlite')
103103
init.initialise(self.dirname, 'sekrit')
104104

105105
# check we can load the package
@@ -129,7 +129,10 @@ def tearDown(self):
129129
def _handle_mail(self, message):
130130
handler = self.instance.MailGW(self.instance, self.db)
131131
handler.trapExceptions = 0
132-
return handler.main(StringIO(message))
132+
ret = handler.main(StringIO(message))
133+
# handler can close the db on us and open a new one
134+
self.db = handler.db
135+
return ret
133136

134137
def _get_mail(self):
135138
f = open(SENDMAILDEBUG)

0 commit comments

Comments
 (0)