comparison test/test_schema.py @ 524:dce4c75bef5a

changed all config accesses... ...so they access either the instance or the config attriubute on the db. This means that all config is obtained from instance_config instead of the mish-mash of classes. This will make switching to a ConfigParser setup easier too, I hope. At a minimum, this makes migration a _little_ easier (a lot easier in the 0.5.0 switch, I hope!)
author Richard Jones <richard@users.sourceforge.net>
date Mon, 14 Jan 2002 02:20:15 +0000
parents f97415cccb9d
children 2dd862af72ee
comparison
equal deleted inserted replaced
523:32db08940334 524:dce4c75bef5a
13 # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 13 # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
14 # FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS" 14 # FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS"
15 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, 15 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
16 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. 16 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
17 # 17 #
18 # $Id: test_schema.py,v 1.6 2001-12-03 21:33:39 richard Exp $ 18 # $Id: test_schema.py,v 1.7 2002-01-14 02:20:15 richard Exp $
19 19
20 import unittest, os, shutil 20 import unittest, os, shutil
21 21
22 from roundup.backends import anydbm 22 from roundup.backends import anydbm
23 from roundup.hyperdb import String, Password, Link, Multilink, Date, \ 23 from roundup.hyperdb import String, Password, Link, Multilink, Date, \
24 Interval, Class 24 Interval, Class
25 25
26 class config:
27 DATABASE='_test_dir'
28 MAILHOST = 'localhost'
29 MAIL_DOMAIN = 'fill.me.in.'
30 INSTANCE_NAME = 'Roundup issue tracker'
31 ISSUE_TRACKER_EMAIL = 'issue_tracker@%s'%MAIL_DOMAIN
32 ISSUE_TRACKER_WEB = 'http://some.useful.url/'
33 ADMIN_EMAIL = 'roundup-admin@%s'%MAIL_DOMAIN
34 FILTER_POSITION = 'bottom' # one of 'top', 'bottom', 'top and bottom'
35 ANONYMOUS_ACCESS = 'deny' # either 'deny' or 'allow'
36 ANONYMOUS_REGISTER = 'deny' # either 'deny' or 'allow'
37 MESSAGES_TO_AUTHOR = 'no' # either 'yes' or 'no'
38 EMAIL_SIGNATURE_POSITION = 'bottom'
39
26 class SchemaTestCase(unittest.TestCase): 40 class SchemaTestCase(unittest.TestCase):
27 def setUp(self): 41 def setUp(self):
28 class Database(anydbm.Database): 42 class Database(anydbm.Database):
29 pass 43 pass
30 # remove previous test, ignore errors 44 # remove previous test, ignore errors
31 if os.path.exists('_test_dir'): 45 if os.path.exists(config.DATABASE):
32 shutil.rmtree('_test_dir') 46 shutil.rmtree(config.DATABASE)
33 os.mkdir('_test_dir') 47 os.makedirs(config.DATABASE + '/files')
34 self.db = Database('_test_dir', 'test') 48 self.db = Database(config, 'test')
35 self.db.clear() 49 self.db.clear()
36 50
37 def tearDown(self): 51 def tearDown(self):
38 shutil.rmtree('_test_dir') 52 shutil.rmtree('_test_dir')
39 53
73 return unittest.makeSuite(SchemaTestCase, 'test') 87 return unittest.makeSuite(SchemaTestCase, 'test')
74 88
75 89
76 # 90 #
77 # $Log: not supported by cvs2svn $ 91 # $Log: not supported by cvs2svn $
92 # Revision 1.6 2001/12/03 21:33:39 richard
93 # Fixes so the tests use commit and not close
94 #
78 # Revision 1.5 2001/10/09 07:25:59 richard 95 # Revision 1.5 2001/10/09 07:25:59 richard
79 # Added the Password property type. See "pydoc roundup.password" for 96 # Added the Password property type. See "pydoc roundup.password" for
80 # implementation details. Have updated some of the documentation too. 97 # implementation details. Have updated some of the documentation too.
81 # 98 #
82 # Revision 1.4 2001/08/07 00:24:43 richard 99 # Revision 1.4 2001/08/07 00:24:43 richard

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