Skip to content

Commit 0a0445c

Browse files
author
Alexander Smishlajev
committed
use tracker setup function from db_test_base
1 parent 5dd47db commit 0a0445c

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

test/test_mailgw.py

Lines changed: 4 additions & 12 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.72 2004-09-29 09:34:26 a1s Exp $
11+
# $Id: test_mailgw.py,v 1.73 2004-10-24 10:01:58 a1s Exp $
1212

1313
# TODO: test bcc
1414

@@ -24,6 +24,7 @@
2424
parseContent, IgnoreLoop, IgnoreBulk
2525
from roundup import init, instance, password, rfc2822, __version__
2626

27+
import db_test_base
2728

2829
class Message(rfc822.Message):
2930
"""String-based Message class with equivalence test."""
@@ -95,17 +96,8 @@ class MailgwTestCase(unittest.TestCase, DiffHelper):
9596
def setUp(self):
9697
MailgwTestCase.count = MailgwTestCase.count + 1
9798
self.dirname = '_test_mailgw_%s'%self.count
98-
try:
99-
shutil.rmtree(self.dirname)
100-
except OSError, error:
101-
if error.errno not in (errno.ENOENT, errno.ESRCH): raise
102-
# create the instance
103-
init.install(self.dirname, 'templates/classic')
104-
init.write_select_db(self.dirname, 'anydbm')
105-
self.instance = tracker = instance.open(self.dirname)
106-
if tracker.exists():
107-
tracker.nuke()
108-
tracker.init(password.Password('sekrit'))
99+
# set up and open a tracker
100+
self.instance = db_test_base.setupTracker(self.dirname)
109101

110102
# and open the database
111103
self.db = self.instance.open('admin')

0 commit comments

Comments
 (0)