Mercurial > p > roundup > code
comparison test/db_test_base.py @ 2082:c091cacdc505
Finished implementation of session and one-time-key stores for RDBMS backends.
Refactored the API of sessions and their interaction with the
backend database a fair bit too.
Added some session tests. Nothing testing ageing yet, 'cos that's a pain
inna ass to test :)
Note: metakit backend still uses the *dbm implementation. It might
want to implement its own session store some day, as it'll be faster than
the *dbm one.
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Thu, 18 Mar 2004 01:58:46 +0000 |
| parents | 3e0961d6d44d |
| children | 93f03c6714d8 |
comparison
equal
deleted
inserted
replaced
| 2081:fb4bf55b94d7 | 2082:c091cacdc505 |
|---|---|
| 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.16 2004-03-15 05:50:20 richard Exp $ | 18 # $Id: db_test_base.py,v 1.17 2004-03-18 01:58:46 richard Exp $ |
| 19 | 19 |
| 20 import unittest, os, shutil, errno, imp, sys, time, pprint | 20 import unittest, os, shutil, errno, imp, sys, time, pprint |
| 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 |
| 53 | 53 |
| 54 class MyTestCase(unittest.TestCase): | 54 class MyTestCase(unittest.TestCase): |
| 55 def tearDown(self): | 55 def tearDown(self): |
| 56 if hasattr(self, 'db'): | 56 if hasattr(self, 'db'): |
| 57 self.db.close() | 57 self.db.close() |
| 58 if os.path.exists('_test_dir'): | 58 if os.path.exists(config.DATABASE): |
| 59 shutil.rmtree('_test_dir') | 59 shutil.rmtree(config.DATABASE) |
| 60 | 60 |
| 61 class config: | 61 class config: |
| 62 DATABASE='_test_dir' | 62 DATABASE='_test_dir' |
| 63 MAILHOST = 'localhost' | 63 MAILHOST = 'localhost' |
| 64 MAIL_DOMAIN = 'fill.me.in.' | 64 MAIL_DOMAIN = 'fill.me.in.' |
