Premiere version : mise en route du suivi.
[auf_roundup.git] / test / test_anydbm.py
1 #
2 # Copyright (c) 2001 Bizar Software Pty Ltd (http://www.bizarsoftware.com.au/)
3 # This module is free software, and you may redistribute it and/or modify
4 # under the same terms as Python, so long as this copyright message and
5 # disclaimer are retained in their original form.
6 #
7 # IN NO EVENT SHALL BIZAR SOFTWARE PTY LTD BE LIABLE TO ANY PARTY FOR
8 # DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING
9 # OUT OF THE USE OF THIS CODE, EVEN IF THE AUTHOR HAS BEEN ADVISED OF THE
10 # POSSIBILITY OF SUCH DAMAGE.
11 #
12 # BIZAR SOFTWARE PTY LTD SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
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"
15 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
16 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
17 #
18 # $Id: test_anydbm.py,v 1.4 2004-11-03 01:34:21 richard Exp $
19
20 import unittest, os, shutil, time
21 from roundup.backends import get_backend
22
23 from db_test_base import DBTest, ROTest, SchemaTest, ClassicInitTest, config
24
25 class anydbmOpener:
26 module = get_backend('anydbm')
27
28 def nuke_database(self):
29 shutil.rmtree(config.DATABASE)
30
31 class anydbmDBTest(anydbmOpener, DBTest):
32 pass
33
34 class anydbmROTest(anydbmOpener, ROTest):
35 pass
36
37 class anydbmSchemaTest(anydbmOpener, SchemaTest):
38 pass
39
40 class anydbmClassicInitTest(ClassicInitTest):
41 backend = 'anydbm'
42
43 from session_common import DBMTest
44 class anydbmSessionTest(anydbmOpener, DBMTest):
45 pass
46
47 def test_suite():
48 suite = unittest.TestSuite()
49 print 'Including anydbm tests'
50 suite.addTest(unittest.makeSuite(anydbmDBTest))
51 suite.addTest(unittest.makeSuite(anydbmROTest))
52 suite.addTest(unittest.makeSuite(anydbmSchemaTest))
53 suite.addTest(unittest.makeSuite(anydbmClassicInitTest))
54 suite.addTest(unittest.makeSuite(anydbmSessionTest))
55 return suite
56
57 if __name__ == '__main__':
58 runner = unittest.TextTestRunner()
59 unittest.main(testRunner=runner)
60
61
62 # vim: set filetype=python ts=4 sw=4 et si