Code

fixed detection of bad date specs (sf bug 691439)
[roundup.git] / test / test_init.py
index eab0160b9df89e1ada65f04652314ecf853c84f3..b58d0cefa04a993467f1eb5881ff7e57faf48a68 100644 (file)
@@ -15,7 +15,7 @@
 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
 # 
-# $Id: test_init.py,v 1.17 2002-09-10 01:27:13 richard Exp $
+# $Id: test_init.py,v 1.22 2003-03-18 00:50:24 richard Exp $
 
 import unittest, os, shutil, errno, imp, sys
 
@@ -43,7 +43,8 @@ class ClassicTestCase(MyTestCase):
         ae = self.assertEqual
 
         # create the instance
-        init.install(self.dirname, 'classic', self.backend)
+        init.install(self.dirname, 'classic')
+        init.write_select_db(self.dirname, self.backend)
         init.initialise(self.dirname, 'sekrit')
 
         # check we can load the package
@@ -77,28 +78,28 @@ class bsddb3ClassicTestCase(ClassicTestCase):
 class metakitClassicTestCase(ClassicTestCase):
     backend = 'metakit'
 
+class mysqlClassicTestCase(ClassicTestCase):
+    backend = 'mysql'
+
+class sqliteClassicTestCase(ClassicTestCase):
+    backend = 'sqlite'
+
 def suite():
     l = [
         unittest.makeSuite(ClassicTestCase, 'test'),
     ]
 
-    try:
-        import bsddb
+    from roundup import backends
+    if hasattr(backends, 'bsddb'):
         l.append(unittest.makeSuite(bsddbClassicTestCase, 'test'))
-    except:
-        print 'bsddb module not found, skipping bsddb DBTestCase'
-
-    try:
-        import bsddb3
+    if hasattr(backends, 'bsddb3'):
         l.append(unittest.makeSuite(bsddb3ClassicTestCase, 'test'))
-    except:
-        print 'bsddb3 module not found, skipping bsddb3 DBTestCase'
-
-    try:
-        import metakit
+    if hasattr(backends, 'metakit'):
         l.append(unittest.makeSuite(metakitClassicTestCase, 'test'))
-    except:
-        print 'metakit module not found, skipping metakit DBTestCase'
+    if hasattr(backends, 'mysql'):
+        l.append(unittest.makeSuite(mysqlClassicTestCase, 'test'))
+    if hasattr(backends, 'sqlite'):
+        l.append(unittest.makeSuite(sqliteClassicTestCase, 'test'))
 
     return unittest.TestSuite(l)