Mercurial > p > roundup > code
comparison test/test_init.py @ 718:e10c37f53efd
fixed SCRIPT_NAME in ZRoundup for instances not at top level of Zope
(thanks dman)
fixed some sorting issues that were breaking some unit tests under py2.2
mailgw test output dir was confusing the init test (but only on 2.2 *shrug*)
fixed bug in the init unit test that meant only the bsddb test ran if it
could (it clobbered the anydbm test)
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Wed, 15 May 2002 03:27:16 +0000 |
| parents | 1fe356fc3d3e |
| children | b105b46f6324 |
comparison
equal
deleted
inserted
replaced
| 717:14e94c28bdb0 | 718:e10c37f53efd |
|---|---|
| 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: test_init.py,v 1.7 2001-10-28 22:51:38 richard Exp $ | 18 # $Id: test_init.py,v 1.8 2002-05-15 03:27:16 richard Exp $ |
| 19 | 19 |
| 20 import unittest, os, shutil, errno, imp, sys | 20 import unittest, os, shutil, errno, imp, sys |
| 21 | 21 |
| 22 from roundup.init import init | 22 from roundup.init import init |
| 23 | 23 |
| 24 class MyTestCase(unittest.TestCase): | 24 class MyTestCase(unittest.TestCase): |
| 25 count = 0 | 25 count = 0 |
| 26 def setUp(self): | 26 def setUp(self): |
| 27 MyTestCase.count = MyTestCase.count + 1 | 27 MyTestCase.count = MyTestCase.count + 1 |
| 28 self.dirname = '_test_%s'%self.count | 28 self.dirname = '_test_init_%s'%self.count |
| 29 try: | 29 try: |
| 30 shutil.rmtree(self.dirname) | 30 shutil.rmtree(self.dirname) |
| 31 except OSError, error: | 31 except OSError, error: |
| 32 if error.errno not in (errno.ENOENT, errno.ESRCH): raise | 32 if error.errno not in (errno.ENOENT, errno.ESRCH): raise |
| 33 | 33 |
| 105 l = db.platform.list() | 105 l = db.platform.list() |
| 106 ae(l, ['1', '2', '3']) | 106 ae(l, ['1', '2', '3']) |
| 107 l = db.timelog.list() | 107 l = db.timelog.list() |
| 108 ae(l, []) | 108 ae(l, []) |
| 109 | 109 |
| 110 class bsddbClassicTestCase(ClassicTestCase): | |
| 111 backend = 'bsddb' | |
| 112 class bsddbExtendedTestCase(ExtendedTestCase): | |
| 113 backend = 'bsddb' | |
| 114 | |
| 115 class bsddb3ClassicTestCase(ClassicTestCase): | |
| 116 backend = 'bsddb3' | |
| 117 class bsddb3ExtendedTestCase(ExtendedTestCase): | |
| 118 backend = 'bsddb3' | |
| 119 | |
| 110 def suite(): | 120 def suite(): |
| 111 l = [unittest.makeSuite(ClassicTestCase, 'test'), | 121 l = [unittest.makeSuite(ClassicTestCase, 'test'), |
| 112 unittest.makeSuite(ExtendedTestCase, 'test')] | 122 unittest.makeSuite(ExtendedTestCase, 'test')] |
| 113 try: | 123 try: |
| 114 import bsddb | 124 import bsddb |
| 115 x = ClassicTestCase | 125 l.append(unittest.makeSuite(bsddbClassicTestCase, 'test')) |
| 116 x.backend = 'bsddb' | 126 l.append(unittest.makeSuite(bsddbExtendedTestCase, 'test')) |
| 117 l.append(unittest.makeSuite(x, 'test')) | |
| 118 x = ExtendedTestCase | |
| 119 x.backend = 'bsddb' | |
| 120 l.append(unittest.makeSuite(x, 'test')) | |
| 121 except: | 127 except: |
| 122 print 'bsddb module not found, skipping bsddb DBTestCase' | 128 print 'bsddb module not found, skipping bsddb DBTestCase' |
| 123 | 129 |
| 124 # try: | 130 # try: |
| 125 # import bsddb3 | 131 # import bsddb3 |
| 126 # x = ClassicTestCase | 132 # l.append(unittest.makeSuite(bsddb3ClassicTestCase, 'test')) |
| 127 # x.backend = 'bsddb3' | 133 # l.append(unittest.makeSuite(bsddb3ExtendedTestCase, 'test')) |
| 128 # l.append(unittest.makeSuite(x, 'test')) | |
| 129 # x = ExtendedTestCase | |
| 130 # x.backend = 'bsddb3' | |
| 131 # l.append(unittest.makeSuite(x, 'test')) | |
| 132 # except: | 134 # except: |
| 133 # print 'bsddb3 module not found, skipping bsddb3 DBTestCase' | 135 # print 'bsddb3 module not found, skipping bsddb3 DBTestCase' |
| 134 | 136 |
| 135 return unittest.TestSuite(l) | 137 return unittest.TestSuite(l) |
| 136 | 138 |
| 137 # | 139 # |
| 138 # $Log: not supported by cvs2svn $ | 140 # $Log: not supported by cvs2svn $ |
| 141 # Revision 1.7 2001/10/28 22:51:38 richard | |
| 142 # Fixed ENOENT/WindowsError thing, thanks Juergen Hermann | |
| 143 # | |
| 139 # Revision 1.6 2001/09/29 23:48:06 richard | 144 # Revision 1.6 2001/09/29 23:48:06 richard |
| 140 # Bug fix for test_init on Windows. | 145 # Bug fix for test_init on Windows. |
| 141 # More documenation!! | 146 # More documenation!! |
| 142 # | 147 # |
| 143 # Revision 1.5 2001/08/29 06:23:59 richard | 148 # Revision 1.5 2001/08/29 06:23:59 richard |
