Mercurial > p > roundup > code
comparison test/db_test_base.py @ 3546:a4edd24c32be
test fixes and checking of indexer overwrites (xapian currently fails)
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Tue, 07 Feb 2006 04:14:32 +0000 |
| parents | 7be25d75c3d5 |
| children | 7728ee93efd2 |
comparison
equal
deleted
inserted
replaced
| 3545:507b2df02956 | 3546:a4edd24c32be |
|---|---|
| 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.64 2006-01-30 00:36:26 richard Exp $ | 18 # $Id: db_test_base.py,v 1.65 2006-02-07 04:14:32 richard Exp $ |
| 19 | 19 |
| 20 import unittest, os, shutil, errno, imp, sys, time, pprint, sets | 20 import unittest, os, shutil, errno, imp, sys, time, pprint, sets |
| 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 |
| 24 from roundup import date, password, init, instance, configuration | 24 from roundup import date, password, init, instance, configuration |
| 25 | 25 |
| 26 from mocknull import MockNull | 26 from mocknull import MockNull |
| 27 | 27 |
| 28 config = configuration.CoreConfig() | 28 config = configuration.CoreConfig() |
| 29 config.DATABASE = "_test_dir" | 29 config.DATABASE = "db" |
| 30 config.RDBMS_NAME = "rounduptest" | 30 config.RDBMS_NAME = "rounduptest" |
| 31 config.RDBMS_HOST = "localhost" | 31 config.RDBMS_HOST = "localhost" |
| 32 config.RDBMS_USER = "rounduptest" | 32 config.RDBMS_USER = "rounduptest" |
| 33 config.RDBMS_PASSWORD = "rounduptest" | 33 config.RDBMS_PASSWORD = "rounduptest" |
| 34 #config.logging = MockNull() | 34 #config.logging = MockNull() |
| 1106 names = items[0] | 1106 names = items[0] |
| 1107 maxid = 1 | 1107 maxid = 1 |
| 1108 for itemprops in items[1:]: | 1108 for itemprops in items[1:]: |
| 1109 id = int(klass.import_list(names, itemprops)) | 1109 id = int(klass.import_list(names, itemprops)) |
| 1110 if hasattr(klass, 'import_files'): | 1110 if hasattr(klass, 'import_files'): |
| 1111 klass.import_files('_test_export', id) | 1111 klass.import_files('_test_export', str(id)) |
| 1112 maxid = max(maxid, id) | 1112 maxid = max(maxid, id) |
| 1113 self.db.setid(cn, str(maxid+1)) | 1113 self.db.setid(cn, str(maxid+1)) |
| 1114 klass.import_journals(journals[cn]) | 1114 klass.import_journals(journals[cn]) |
| 1115 finally: | 1115 finally: |
| 1116 shutil.rmtree('_test_export') | 1116 shutil.rmtree('_test_export') |
