|
8 | 8 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
9 | 9 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
10 | 10 | # |
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 $ |
12 | 12 |
|
13 | 13 | # TODO: test bcc |
14 | 14 |
|
|
24 | 24 | parseContent, IgnoreLoop, IgnoreBulk |
25 | 25 | from roundup import init, instance, password, rfc2822, __version__ |
26 | 26 |
|
| 27 | +import db_test_base |
27 | 28 |
|
28 | 29 | class Message(rfc822.Message): |
29 | 30 | """String-based Message class with equivalence test.""" |
@@ -95,17 +96,8 @@ class MailgwTestCase(unittest.TestCase, DiffHelper): |
95 | 96 | def setUp(self): |
96 | 97 | MailgwTestCase.count = MailgwTestCase.count + 1 |
97 | 98 | 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) |
109 | 101 |
|
110 | 102 | # and open the database |
111 | 103 | self.db = self.instance.open('admin') |
|
0 commit comments