Skip to content

Commit 5dd47db

Browse files
author
Alexander Smishlajev
committed
use tracker setup function from db_test_base;
remove hand-made 'config' class - unused.
1 parent 30fc0ff commit 5dd47db

File tree

1 file changed

+5
-16
lines changed

1 file changed

+5
-16
lines changed

test/test_cgi.py

Lines changed: 5 additions & 16 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_cgi.py,v 1.24 2004-09-28 10:47:20 a1s Exp $
11+
# $Id: test_cgi.py,v 1.25 2004-10-24 10:00:13 a1s Exp $
1212

1313
import unittest, os, shutil, errno, sys, difflib, cgi, re
1414

@@ -17,6 +17,8 @@
1717
from roundup.cgi.form_parser import FormParser
1818
from roundup import init, instance, password, hyperdb, date
1919

20+
import db_test_base
21+
2022
NEEDS_INSTANCE = 1
2123

2224
class FileUpload:
@@ -37,10 +39,6 @@ def makeForm(args):
3739
form.list.append(cgi.MiniFieldStorage(k, v))
3840
return form
3941

40-
class config:
41-
TRACKER_NAME = 'testing testing'
42-
TRACKER_WEB = 'http://testing.testing/'
43-
4442
cm = client.clean_message
4543
class MessageTestCase(unittest.TestCase):
4644
def testCleanMessageOK(self):
@@ -64,17 +62,8 @@ def testCleanMessageBAD(self):
6462
class FormTestCase(unittest.TestCase):
6563
def setUp(self):
6664
self.dirname = '_test_cgi_form'
67-
try:
68-
shutil.rmtree(self.dirname)
69-
except OSError, error:
70-
if error.errno not in (errno.ENOENT, errno.ESRCH): raise
71-
# create the instance
72-
init.install(self.dirname, 'templates/classic')
73-
init.write_select_db(self.dirname, 'anydbm')
74-
self.instance = tracker = instance.open(self.dirname)
75-
if tracker.exists():
76-
tracker.nuke()
77-
tracker.init(password.Password('sekrit'))
65+
# set up and open a tracker
66+
self.instance = db_test_base.setupTracker(self.dirname)
7867

7968
# open the database
8069
self.db = self.instance.open('admin')

0 commit comments

Comments
 (0)