|
15 | 15 | # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, |
16 | 16 | # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. |
17 | 17 | # |
18 | | -# $Id: test_db.py,v 1.66 2003-01-13 23:32:12 richard Exp $ |
| 18 | +# $Id: test_db.py,v 1.67 2003-01-14 10:52:05 richard Exp $ |
19 | 19 |
|
20 | 20 | import unittest, os, shutil, time |
21 | 21 |
|
@@ -205,6 +205,10 @@ def testKeyValue(self): |
205 | 205 | self.db.user.retire(newid) |
206 | 206 | self.assertRaises(KeyError, self.db.user.lookup, 'spam') |
207 | 207 |
|
| 208 | + # use the key again now that the old is retired |
| 209 | + newid2 = self.db.user.create(username="spam") |
| 210 | + self.assertNotEqual(newid, newid2) |
| 211 | + |
208 | 212 | def testNewProperty(self): |
209 | 213 | self.db.issue.create(title="spam", status='1') |
210 | 214 | self.db.issue.addprop(fixer=Link("user")) |
@@ -702,6 +706,13 @@ def setUp(self): |
702 | 706 | setupSchema(self.db, 0, gadfly) |
703 | 707 |
|
704 | 708 |
|
| 709 | +# XXX to fix the mysql tests... |
| 710 | +# From: Andrey Lebedev <[email protected]> |
| 711 | +# I believe we can DROP DATABASE <dbname> and then CREATE DATABASE |
| 712 | +# <dbname>.. it's an easiest way. This will work if db user has all |
| 713 | +# privileges on database. |
| 714 | +# Another way - to perform "SHOW TABLES" SQL and then perform DROP TABLE |
| 715 | +# <tblname> on each table... |
705 | 716 | class mysqlDBTestCase(anydbmDBTestCase): |
706 | 717 | def setUp(self): |
707 | 718 | from roundup.backends import mysql |
@@ -820,31 +831,39 @@ def suite(): |
820 | 831 | # return unittest.TestSuite(l) |
821 | 832 |
|
822 | 833 | from roundup import backends |
823 | | - if hasattr(backends, 'mysql'): |
824 | | - l.append(unittest.makeSuite(mysqlDBTestCase, 'test')) |
825 | | - l.append(unittest.makeSuite(mysqlReadOnlyDBTestCase, 'test')) |
| 834 | + p = [] |
| 835 | +# if hasattr(backends, 'mysql'): |
| 836 | +# p.append('mysql') |
| 837 | +# l.append(unittest.makeSuite(mysqlDBTestCase, 'test')) |
| 838 | +# l.append(unittest.makeSuite(mysqlReadOnlyDBTestCase, 'test')) |
826 | 839 | # return unittest.TestSuite(l) |
827 | 840 |
|
828 | 841 | if hasattr(backends, 'gadfly'): |
| 842 | + p.append('gadfly') |
829 | 843 | l.append(unittest.makeSuite(gadflyDBTestCase, 'test')) |
830 | 844 | l.append(unittest.makeSuite(gadflyReadOnlyDBTestCase, 'test')) |
831 | 845 |
|
832 | 846 | if hasattr(backends, 'sqlite'): |
| 847 | + p.append('sqlite') |
833 | 848 | l.append(unittest.makeSuite(sqliteDBTestCase, 'test')) |
834 | 849 | l.append(unittest.makeSuite(sqliteReadOnlyDBTestCase, 'test')) |
835 | 850 |
|
836 | 851 | if hasattr(backends, 'bsddb'): |
| 852 | + p.append('bsddb') |
837 | 853 | l.append(unittest.makeSuite(bsddbDBTestCase, 'test')) |
838 | 854 | l.append(unittest.makeSuite(bsddbReadOnlyDBTestCase, 'test')) |
839 | 855 |
|
840 | 856 | if hasattr(backends, 'bsddb3'): |
| 857 | + p.append('bsddb3') |
841 | 858 | l.append(unittest.makeSuite(bsddb3DBTestCase, 'test')) |
842 | 859 | l.append(unittest.makeSuite(bsddb3ReadOnlyDBTestCase, 'test')) |
843 | 860 |
|
844 | 861 | if hasattr(backends, 'metakit'): |
| 862 | + p.append('metakit') |
845 | 863 | l.append(unittest.makeSuite(metakitDBTestCase, 'test')) |
846 | 864 | l.append(unittest.makeSuite(metakitReadOnlyDBTestCase, 'test')) |
847 | 865 |
|
| 866 | + print 'running %s backend tests'%(', '.join(p)) |
848 | 867 | return unittest.TestSuite(l) |
849 | 868 |
|
850 | 869 | # vim: set filetype=python ts=4 sw=4 et si |
0 commit comments