Mercurial > p > roundup > code
comparison test/db_test_base.py @ 1898:f3d25c512931
Remove duplication:
use a 'extra_config' attribute which is appended to the config file
for testCreation.
| author | Johannes Gijsbers <jlgijsbers@users.sourceforge.net> |
|---|---|
| date | Wed, 05 Nov 2003 21:54:57 +0000 |
| parents | 3ead7f982792 |
| children | 9445caec3ff5 |
comparison
equal
deleted
inserted
replaced
| 1897:3ead7f982792 | 1898:f3d25c512931 |
|---|---|
| 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: db_test_base.py,v 1.3 2003-11-05 01:38:52 richard Exp $ | 18 # $Id: db_test_base.py,v 1.4 2003-11-05 21:54:57 jlgijsbers Exp $ |
| 19 | 19 |
| 20 import unittest, os, shutil, errno, imp, sys, time | 20 import unittest, os, shutil, errno, imp, sys, time |
| 21 | 21 |
| 22 from roundup.hyperdb import String, Password, Link, Multilink, Date, \ | 22 from roundup.hyperdb import String, Password, Link, Multilink, Date, \ |
| 23 Interval, DatabaseError, Boolean, Number, Node | 23 Interval, DatabaseError, Boolean, Number, Node |
| 974 ae = self.assertEqual | 974 ae = self.assertEqual |
| 975 | 975 |
| 976 # create the instance | 976 # create the instance |
| 977 init.install(self.dirname, 'templates/classic') | 977 init.install(self.dirname, 'templates/classic') |
| 978 init.write_select_db(self.dirname, self.backend) | 978 init.write_select_db(self.dirname, self.backend) |
| 979 | |
| 980 if self.extra_config: | |
| 981 f = open(os.path.join(self.dirname, 'config.py'), 'a') | |
| 982 try: | |
| 983 f.write(self.extra_config) | |
| 984 finally: | |
| 985 f.close() | |
| 986 | |
| 979 init.initialise(self.dirname, 'sekrit') | 987 init.initialise(self.dirname, 'sekrit') |
| 980 | 988 |
| 981 # check we can load the package | 989 # check we can load the package |
| 982 instance = imp.load_package(self.dirname, self.dirname) | 990 instance = imp.load_package(self.dirname, self.dirname) |
| 983 | 991 |
