Mercurial > p > roundup > code
comparison test/db_test_base.py @ 1906:f255363e6d97
PostgreSQL backend lands.
- that's the postgresql backend in (cleaned up doc, unit testing harness and
the backend module itself)
- also cleaned up the index maintenance code (actual checks for existence
rather than bare-except failure mode)
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Tue, 11 Nov 2003 11:19:18 +0000 |
| parents | 9445caec3ff5 |
| children | 2b0ab61db194 |
comparison
equal
deleted
inserted
replaced
| 1905:dc43e339e607 | 1906:f255363e6d97 |
|---|---|
| 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.5 2003-11-10 03:56:39 richard Exp $ | 18 # $Id: db_test_base.py,v 1.6 2003-11-11 11:19:18 richard 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 |
| 66 ANONYMOUS_ACCESS = 'deny' # either 'deny' or 'allow' | 66 ANONYMOUS_ACCESS = 'deny' # either 'deny' or 'allow' |
| 67 ANONYMOUS_REGISTER = 'deny' # either 'deny' or 'allow' | 67 ANONYMOUS_REGISTER = 'deny' # either 'deny' or 'allow' |
| 68 MESSAGES_TO_AUTHOR = 'no' # either 'yes' or 'no' | 68 MESSAGES_TO_AUTHOR = 'no' # either 'yes' or 'no' |
| 69 EMAIL_SIGNATURE_POSITION = 'bottom' | 69 EMAIL_SIGNATURE_POSITION = 'bottom' |
| 70 | 70 |
| 71 # Mysql connection data | |
| 72 MYSQL_DBHOST = 'localhost' | |
| 73 MYSQL_DBUSER = 'rounduptest' | |
| 74 MYSQL_DBPASSWORD = 'rounduptest' | |
| 75 MYSQL_DBNAME = 'rounduptest' | |
| 76 MYSQL_DATABASE = (MYSQL_DBHOST, MYSQL_DBUSER, MYSQL_DBPASSWORD, MYSQL_DBNAME) | |
| 77 | |
| 78 # Postgresql connection data | |
| 79 POSTGRESQL_DBHOST = 'localhost' | |
| 80 POSTGRESQL_DBUSER = 'rounduptest' | |
| 81 POSTGRESQL_DBPASSWORD = 'rounduptest' | |
| 82 POSTGRESQL_DBNAME = 'rounduptest' | |
| 83 POSTGRESQL_PORT = 5432 | |
| 84 POSTGRESQL_DATABASE = {'host': POSTGRESQL_DBHOST, 'port': POSTGRESQL_PORT, | |
| 85 'user': POSTGRESQL_DBUSER, 'password': POSTGRESQL_DBPASSWORD, | |
| 86 'database': POSTGRESQL_DBNAME} | |
| 87 | |
| 88 class nodbconfig(config): | |
| 89 MYSQL_DATABASE = (config.MYSQL_DBHOST, config.MYSQL_DBUSER, config.MYSQL_DBPASSWORD) | |
| 90 | 71 |
| 91 class DBTest(MyTestCase): | 72 class DBTest(MyTestCase): |
| 92 def setUp(self): | 73 def setUp(self): |
| 93 # remove previous test, ignore errors | 74 # remove previous test, ignore errors |
| 94 if os.path.exists(config.DATABASE): | 75 if os.path.exists(config.DATABASE): |
