comparison test/test_mailgw.py @ 1126:d77b86cc541b

close the databases before test cleanup
author Richard Jones <richard@users.sourceforge.net>
date Thu, 12 Sep 2002 04:21:21 +0000
parents 711f2ecee20f
children bd3b57859c37
comparison
equal deleted inserted replaced
1125:3c1533be3822 1126:d77b86cc541b
6 # 6 #
7 # This module is distributed in the hope that it will be useful, 7 # This module is distributed in the hope that it will be useful,
8 # but WITHOUT ANY WARRANTY; without even the implied warranty of 8 # but WITHOUT ANY WARRANTY; without even the implied warranty of
9 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 9 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10 # 10 #
11 # $Id: test_mailgw.py,v 1.29 2002-09-10 02:37:28 richard Exp $ 11 # $Id: test_mailgw.py,v 1.30 2002-09-12 04:21:20 richard Exp $
12 12
13 import unittest, cStringIO, tempfile, os, shutil, errno, imp, sys, difflib 13 import unittest, cStringIO, tempfile, os, shutil, errno, imp, sys, difflib
14 14
15 # Note: Should parse emails according to RFC2822 instead of performing a 15 # Note: Should parse emails according to RFC2822 instead of performing a
16 # literal string comparision. Parsing the messages allows the tests to work for 16 # literal string comparision. Parsing the messages allows the tests to work for
90 alternate_addresses='jondoe@test\njohn.doe@test', roles='User') 90 alternate_addresses='jondoe@test\njohn.doe@test', roles='User')
91 91
92 def tearDown(self): 92 def tearDown(self):
93 if os.path.exists(os.environ['SENDMAILDEBUG']): 93 if os.path.exists(os.environ['SENDMAILDEBUG']):
94 os.remove(os.environ['SENDMAILDEBUG']) 94 os.remove(os.environ['SENDMAILDEBUG'])
95 self.db.close()
95 try: 96 try:
96 shutil.rmtree(self.dirname) 97 shutil.rmtree(self.dirname)
97 except OSError, error: 98 except OSError, error:
98 if error.errno not in (errno.ENOENT, errno.ESRCH): raise 99 if error.errno not in (errno.ENOENT, errno.ESRCH): raise
99 100

Roundup Issue Tracker: http://roundup-tracker.org/