annotate Lib/bsddb/test/test_sequence.py @ 79675:c0a2294de787 2.7

Issue #16199: Backport 2to3 typo fix from 3.2.
author Chris Jerdonek <chris.jerdonek@gmail.com>
date Thu, 11 Oct 2012 16:15:46 -0700
parents 614c84670c63
children 83fd64c97296
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
38608
6649b51e245f forgot to add this file in previous commit
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
1 import unittest
6649b51e245f forgot to add this file in previous commit
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
2 import os
6649b51e245f forgot to add this file in previous commit
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
3
48910
81a1a1545172 Update bsddb code to version 4.7.3pre2. This code should
Jesus Cea <jcea@jcea.es>
parents: 47213
diff changeset
4 from test_all import db, test_support, get_new_environment_path, get_new_database_path
46984
e4e3b3eba226 Testsuite for bsddb module, version 4.6.4
Jesus Cea <jcea@jcea.es>
parents: 45617
diff changeset
5
38608
6649b51e245f forgot to add this file in previous commit
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
6
6649b51e245f forgot to add this file in previous commit
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
7 class DBSequenceTest(unittest.TestCase):
46984
e4e3b3eba226 Testsuite for bsddb module, version 4.6.4
Jesus Cea <jcea@jcea.es>
parents: 45617
diff changeset
8 import sys
59902
96a241d4a0ab pybsddb 4.8.4 integration. Please, comment in issue #8156
Jesus Cea <jcea@jcea.es>
parents: 48910
diff changeset
9 if sys.version_info < (2, 4) :
46984
e4e3b3eba226 Testsuite for bsddb module, version 4.6.4
Jesus Cea <jcea@jcea.es>
parents: 45617
diff changeset
10 def assertTrue(self, expr, msg=None):
e4e3b3eba226 Testsuite for bsddb module, version 4.6.4
Jesus Cea <jcea@jcea.es>
parents: 45617
diff changeset
11 self.failUnless(expr,msg=msg)
e4e3b3eba226 Testsuite for bsddb module, version 4.6.4
Jesus Cea <jcea@jcea.es>
parents: 45617
diff changeset
12
38608
6649b51e245f forgot to add this file in previous commit
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
13 def setUp(self):
6649b51e245f forgot to add this file in previous commit
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
14 self.int_32_max = 0x100000000
46984
e4e3b3eba226 Testsuite for bsddb module, version 4.6.4
Jesus Cea <jcea@jcea.es>
parents: 45617
diff changeset
15 self.homeDir = get_new_environment_path()
e4e3b3eba226 Testsuite for bsddb module, version 4.6.4
Jesus Cea <jcea@jcea.es>
parents: 45617
diff changeset
16 self.filename = "test"
38608
6649b51e245f forgot to add this file in previous commit
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
17
6649b51e245f forgot to add this file in previous commit
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
18 self.dbenv = db.DBEnv()
6649b51e245f forgot to add this file in previous commit
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
19 self.dbenv.open(self.homeDir, db.DB_CREATE | db.DB_INIT_MPOOL, 0666)
6649b51e245f forgot to add this file in previous commit
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
20 self.d = db.DB(self.dbenv)
6649b51e245f forgot to add this file in previous commit
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
21 self.d.open(self.filename, db.DB_BTREE, db.DB_CREATE, 0666)
6649b51e245f forgot to add this file in previous commit
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
22
6649b51e245f forgot to add this file in previous commit
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
23 def tearDown(self):
6649b51e245f forgot to add this file in previous commit
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
24 if hasattr(self, 'seq'):
6649b51e245f forgot to add this file in previous commit
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
25 self.seq.close()
6649b51e245f forgot to add this file in previous commit
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
26 del self.seq
6649b51e245f forgot to add this file in previous commit
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
27 if hasattr(self, 'd'):
6649b51e245f forgot to add this file in previous commit
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
28 self.d.close()
6649b51e245f forgot to add this file in previous commit
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
29 del self.d
6649b51e245f forgot to add this file in previous commit
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
30 if hasattr(self, 'dbenv'):
6649b51e245f forgot to add this file in previous commit
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
31 self.dbenv.close()
6649b51e245f forgot to add this file in previous commit
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
32 del self.dbenv
6649b51e245f forgot to add this file in previous commit
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
33
45506
55eefb43ef6f Create a db_home directory with a unique name so multiple users can
Neal Norwitz <nnorwitz@gmail.com>
parents: 45468
diff changeset
34 test_support.rmtree(self.homeDir)
38608
6649b51e245f forgot to add this file in previous commit
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
35
6649b51e245f forgot to add this file in previous commit
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
36 def test_get(self):
6649b51e245f forgot to add this file in previous commit
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
37 self.seq = db.DBSequence(self.d, flags=0)
6649b51e245f forgot to add this file in previous commit
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
38 start_value = 10 * self.int_32_max
6649b51e245f forgot to add this file in previous commit
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
39 self.assertEqual(0xA00000000, start_value)
66348
614c84670c63 Merged revisions 86596 via svnmerge from
Ezio Melotti <ezio.melotti@gmail.com>
parents: 59902
diff changeset
40 self.assertEqual(None, self.seq.initial_value(start_value))
614c84670c63 Merged revisions 86596 via svnmerge from
Ezio Melotti <ezio.melotti@gmail.com>
parents: 59902
diff changeset
41 self.assertEqual(None, self.seq.open(key='id', txn=None, flags=db.DB_CREATE))
614c84670c63 Merged revisions 86596 via svnmerge from
Ezio Melotti <ezio.melotti@gmail.com>
parents: 59902
diff changeset
42 self.assertEqual(start_value, self.seq.get(5))
614c84670c63 Merged revisions 86596 via svnmerge from
Ezio Melotti <ezio.melotti@gmail.com>
parents: 59902
diff changeset
43 self.assertEqual(start_value + 5, self.seq.get())
38608
6649b51e245f forgot to add this file in previous commit
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
44
6649b51e245f forgot to add this file in previous commit
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
45 def test_remove(self):
6649b51e245f forgot to add this file in previous commit
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
46 self.seq = db.DBSequence(self.d, flags=0)
66348
614c84670c63 Merged revisions 86596 via svnmerge from
Ezio Melotti <ezio.melotti@gmail.com>
parents: 59902
diff changeset
47 self.assertEqual(None, self.seq.open(key='foo', txn=None, flags=db.DB_CREATE))
614c84670c63 Merged revisions 86596 via svnmerge from
Ezio Melotti <ezio.melotti@gmail.com>
parents: 59902
diff changeset
48 self.assertEqual(None, self.seq.remove(txn=None, flags=0))
38608
6649b51e245f forgot to add this file in previous commit
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
49 del self.seq
6649b51e245f forgot to add this file in previous commit
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
50
6649b51e245f forgot to add this file in previous commit
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
51 def test_get_key(self):
6649b51e245f forgot to add this file in previous commit
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
52 self.seq = db.DBSequence(self.d, flags=0)
6649b51e245f forgot to add this file in previous commit
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
53 key = 'foo'
66348
614c84670c63 Merged revisions 86596 via svnmerge from
Ezio Melotti <ezio.melotti@gmail.com>
parents: 59902
diff changeset
54 self.assertEqual(None, self.seq.open(key=key, txn=None, flags=db.DB_CREATE))
614c84670c63 Merged revisions 86596 via svnmerge from
Ezio Melotti <ezio.melotti@gmail.com>
parents: 59902
diff changeset
55 self.assertEqual(key, self.seq.get_key())
38608
6649b51e245f forgot to add this file in previous commit
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
56
6649b51e245f forgot to add this file in previous commit
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
57 def test_get_dbp(self):
6649b51e245f forgot to add this file in previous commit
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
58 self.seq = db.DBSequence(self.d, flags=0)
66348
614c84670c63 Merged revisions 86596 via svnmerge from
Ezio Melotti <ezio.melotti@gmail.com>
parents: 59902
diff changeset
59 self.assertEqual(None, self.seq.open(key='foo', txn=None, flags=db.DB_CREATE))
614c84670c63 Merged revisions 86596 via svnmerge from
Ezio Melotti <ezio.melotti@gmail.com>
parents: 59902
diff changeset
60 self.assertEqual(self.d, self.seq.get_dbp())
38608
6649b51e245f forgot to add this file in previous commit
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
61
6649b51e245f forgot to add this file in previous commit
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
62 def test_cachesize(self):
6649b51e245f forgot to add this file in previous commit
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
63 self.seq = db.DBSequence(self.d, flags=0)
6649b51e245f forgot to add this file in previous commit
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
64 cashe_size = 10
66348
614c84670c63 Merged revisions 86596 via svnmerge from
Ezio Melotti <ezio.melotti@gmail.com>
parents: 59902
diff changeset
65 self.assertEqual(None, self.seq.set_cachesize(cashe_size))
614c84670c63 Merged revisions 86596 via svnmerge from
Ezio Melotti <ezio.melotti@gmail.com>
parents: 59902
diff changeset
66 self.assertEqual(None, self.seq.open(key='foo', txn=None, flags=db.DB_CREATE))
614c84670c63 Merged revisions 86596 via svnmerge from
Ezio Melotti <ezio.melotti@gmail.com>
parents: 59902
diff changeset
67 self.assertEqual(cashe_size, self.seq.get_cachesize())
38608
6649b51e245f forgot to add this file in previous commit
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
68
6649b51e245f forgot to add this file in previous commit
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
69 def test_flags(self):
6649b51e245f forgot to add this file in previous commit
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
70 self.seq = db.DBSequence(self.d, flags=0)
6649b51e245f forgot to add this file in previous commit
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
71 flag = db.DB_SEQ_WRAP;
66348
614c84670c63 Merged revisions 86596 via svnmerge from
Ezio Melotti <ezio.melotti@gmail.com>
parents: 59902
diff changeset
72 self.assertEqual(None, self.seq.set_flags(flag))
614c84670c63 Merged revisions 86596 via svnmerge from
Ezio Melotti <ezio.melotti@gmail.com>
parents: 59902
diff changeset
73 self.assertEqual(None, self.seq.open(key='foo', txn=None, flags=db.DB_CREATE))
614c84670c63 Merged revisions 86596 via svnmerge from
Ezio Melotti <ezio.melotti@gmail.com>
parents: 59902
diff changeset
74 self.assertEqual(flag, self.seq.get_flags() & flag)
38608
6649b51e245f forgot to add this file in previous commit
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
75
6649b51e245f forgot to add this file in previous commit
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
76 def test_range(self):
6649b51e245f forgot to add this file in previous commit
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
77 self.seq = db.DBSequence(self.d, flags=0)
6649b51e245f forgot to add this file in previous commit
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
78 seq_range = (10 * self.int_32_max, 11 * self.int_32_max - 1)
66348
614c84670c63 Merged revisions 86596 via svnmerge from
Ezio Melotti <ezio.melotti@gmail.com>
parents: 59902
diff changeset
79 self.assertEqual(None, self.seq.set_range(seq_range))
59902
96a241d4a0ab pybsddb 4.8.4 integration. Please, comment in issue #8156
Jesus Cea <jcea@jcea.es>
parents: 48910
diff changeset
80 self.seq.initial_value(seq_range[0])
66348
614c84670c63 Merged revisions 86596 via svnmerge from
Ezio Melotti <ezio.melotti@gmail.com>
parents: 59902
diff changeset
81 self.assertEqual(None, self.seq.open(key='foo', txn=None, flags=db.DB_CREATE))
614c84670c63 Merged revisions 86596 via svnmerge from
Ezio Melotti <ezio.melotti@gmail.com>
parents: 59902
diff changeset
82 self.assertEqual(seq_range, self.seq.get_range())
38608
6649b51e245f forgot to add this file in previous commit
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
83
6649b51e245f forgot to add this file in previous commit
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
84 def test_stat(self):
6649b51e245f forgot to add this file in previous commit
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
85 self.seq = db.DBSequence(self.d, flags=0)
66348
614c84670c63 Merged revisions 86596 via svnmerge from
Ezio Melotti <ezio.melotti@gmail.com>
parents: 59902
diff changeset
86 self.assertEqual(None, self.seq.open(key='foo', txn=None, flags=db.DB_CREATE))
38608
6649b51e245f forgot to add this file in previous commit
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
87 stat = self.seq.stat()
6649b51e245f forgot to add this file in previous commit
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
88 for param in ('nowait', 'min', 'max', 'value', 'current',
6649b51e245f forgot to add this file in previous commit
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
89 'flags', 'cache_size', 'last_value', 'wait'):
6649b51e245f forgot to add this file in previous commit
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
90 self.assertTrue(param in stat, "parameter %s isn't in stat info" % param)
6649b51e245f forgot to add this file in previous commit
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
91
46984
e4e3b3eba226 Testsuite for bsddb module, version 4.6.4
Jesus Cea <jcea@jcea.es>
parents: 45617
diff changeset
92 if db.version() >= (4,7) :
e4e3b3eba226 Testsuite for bsddb module, version 4.6.4
Jesus Cea <jcea@jcea.es>
parents: 45617
diff changeset
93 # This code checks a crash solved in Berkeley DB 4.7
e4e3b3eba226 Testsuite for bsddb module, version 4.6.4
Jesus Cea <jcea@jcea.es>
parents: 45617
diff changeset
94 def test_stat_crash(self) :
e4e3b3eba226 Testsuite for bsddb module, version 4.6.4
Jesus Cea <jcea@jcea.es>
parents: 45617
diff changeset
95 d=db.DB()
e4e3b3eba226 Testsuite for bsddb module, version 4.6.4
Jesus Cea <jcea@jcea.es>
parents: 45617
diff changeset
96 d.open(None,dbtype=db.DB_HASH,flags=db.DB_CREATE) # In RAM
e4e3b3eba226 Testsuite for bsddb module, version 4.6.4
Jesus Cea <jcea@jcea.es>
parents: 45617
diff changeset
97 seq = db.DBSequence(d, flags=0)
e4e3b3eba226 Testsuite for bsddb module, version 4.6.4
Jesus Cea <jcea@jcea.es>
parents: 45617
diff changeset
98
e4e3b3eba226 Testsuite for bsddb module, version 4.6.4
Jesus Cea <jcea@jcea.es>
parents: 45617
diff changeset
99 self.assertRaises(db.DBNotFoundError, seq.open,
e4e3b3eba226 Testsuite for bsddb module, version 4.6.4
Jesus Cea <jcea@jcea.es>
parents: 45617
diff changeset
100 key='id', txn=None, flags=0)
e4e3b3eba226 Testsuite for bsddb module, version 4.6.4
Jesus Cea <jcea@jcea.es>
parents: 45617
diff changeset
101
47213
4f6ea5c59ab3 bsddb module updated to version 4.7.0
Jesus Cea <jcea@jcea.es>
parents: 47173
diff changeset
102 self.assertRaises(db.DBInvalidArgError, seq.stat)
46984
e4e3b3eba226 Testsuite for bsddb module, version 4.6.4
Jesus Cea <jcea@jcea.es>
parents: 45617
diff changeset
103
e4e3b3eba226 Testsuite for bsddb module, version 4.6.4
Jesus Cea <jcea@jcea.es>
parents: 45617
diff changeset
104 d.close()
e4e3b3eba226 Testsuite for bsddb module, version 4.6.4
Jesus Cea <jcea@jcea.es>
parents: 45617
diff changeset
105
e4e3b3eba226 Testsuite for bsddb module, version 4.6.4
Jesus Cea <jcea@jcea.es>
parents: 45617
diff changeset
106 def test_64bits(self) :
47173
e80850055b93 bsddb: Beware with sequence wrapping
Jesus Cea <jcea@jcea.es>
parents: 46984
diff changeset
107 # We don't use both extremes because they are problematic
e80850055b93 bsddb: Beware with sequence wrapping
Jesus Cea <jcea@jcea.es>
parents: 46984
diff changeset
108 value_plus=(1L<<63)-2
66348
614c84670c63 Merged revisions 86596 via svnmerge from
Ezio Melotti <ezio.melotti@gmail.com>
parents: 59902
diff changeset
109 self.assertEqual(9223372036854775806L,value_plus)
47173
e80850055b93 bsddb: Beware with sequence wrapping
Jesus Cea <jcea@jcea.es>
parents: 46984
diff changeset
110 value_minus=(-1L<<63)+1 # Two complement
66348
614c84670c63 Merged revisions 86596 via svnmerge from
Ezio Melotti <ezio.melotti@gmail.com>
parents: 59902
diff changeset
111 self.assertEqual(-9223372036854775807L,value_minus)
46984
e4e3b3eba226 Testsuite for bsddb module, version 4.6.4
Jesus Cea <jcea@jcea.es>
parents: 45617
diff changeset
112 self.seq = db.DBSequence(self.d, flags=0)
66348
614c84670c63 Merged revisions 86596 via svnmerge from
Ezio Melotti <ezio.melotti@gmail.com>
parents: 59902
diff changeset
113 self.assertEqual(None, self.seq.initial_value(value_plus-1))
614c84670c63 Merged revisions 86596 via svnmerge from
Ezio Melotti <ezio.melotti@gmail.com>
parents: 59902
diff changeset
114 self.assertEqual(None, self.seq.open(key='id', txn=None,
46984
e4e3b3eba226 Testsuite for bsddb module, version 4.6.4
Jesus Cea <jcea@jcea.es>
parents: 45617
diff changeset
115 flags=db.DB_CREATE))
66348
614c84670c63 Merged revisions 86596 via svnmerge from
Ezio Melotti <ezio.melotti@gmail.com>
parents: 59902
diff changeset
116 self.assertEqual(value_plus-1, self.seq.get(1))
614c84670c63 Merged revisions 86596 via svnmerge from
Ezio Melotti <ezio.melotti@gmail.com>
parents: 59902
diff changeset
117 self.assertEqual(value_plus, self.seq.get(1))
46984
e4e3b3eba226 Testsuite for bsddb module, version 4.6.4
Jesus Cea <jcea@jcea.es>
parents: 45617
diff changeset
118
e4e3b3eba226 Testsuite for bsddb module, version 4.6.4
Jesus Cea <jcea@jcea.es>
parents: 45617
diff changeset
119 self.seq.remove(txn=None, flags=0)
e4e3b3eba226 Testsuite for bsddb module, version 4.6.4
Jesus Cea <jcea@jcea.es>
parents: 45617
diff changeset
120
e4e3b3eba226 Testsuite for bsddb module, version 4.6.4
Jesus Cea <jcea@jcea.es>
parents: 45617
diff changeset
121 self.seq = db.DBSequence(self.d, flags=0)
66348
614c84670c63 Merged revisions 86596 via svnmerge from
Ezio Melotti <ezio.melotti@gmail.com>
parents: 59902
diff changeset
122 self.assertEqual(None, self.seq.initial_value(value_minus))
614c84670c63 Merged revisions 86596 via svnmerge from
Ezio Melotti <ezio.melotti@gmail.com>
parents: 59902
diff changeset
123 self.assertEqual(None, self.seq.open(key='id', txn=None,
46984
e4e3b3eba226 Testsuite for bsddb module, version 4.6.4
Jesus Cea <jcea@jcea.es>
parents: 45617
diff changeset
124 flags=db.DB_CREATE))
66348
614c84670c63 Merged revisions 86596 via svnmerge from
Ezio Melotti <ezio.melotti@gmail.com>
parents: 59902
diff changeset
125 self.assertEqual(value_minus, self.seq.get(1))
614c84670c63 Merged revisions 86596 via svnmerge from
Ezio Melotti <ezio.melotti@gmail.com>
parents: 59902
diff changeset
126 self.assertEqual(value_minus+1, self.seq.get(1))
46984
e4e3b3eba226 Testsuite for bsddb module, version 4.6.4
Jesus Cea <jcea@jcea.es>
parents: 45617
diff changeset
127
e4e3b3eba226 Testsuite for bsddb module, version 4.6.4
Jesus Cea <jcea@jcea.es>
parents: 45617
diff changeset
128 def test_multiple_close(self):
e4e3b3eba226 Testsuite for bsddb module, version 4.6.4
Jesus Cea <jcea@jcea.es>
parents: 45617
diff changeset
129 self.seq = db.DBSequence(self.d)
e4e3b3eba226 Testsuite for bsddb module, version 4.6.4
Jesus Cea <jcea@jcea.es>
parents: 45617
diff changeset
130 self.seq.close() # You can close a Sequence multiple times
e4e3b3eba226 Testsuite for bsddb module, version 4.6.4
Jesus Cea <jcea@jcea.es>
parents: 45617
diff changeset
131 self.seq.close()
e4e3b3eba226 Testsuite for bsddb module, version 4.6.4
Jesus Cea <jcea@jcea.es>
parents: 45617
diff changeset
132 self.seq.close()
e4e3b3eba226 Testsuite for bsddb module, version 4.6.4
Jesus Cea <jcea@jcea.es>
parents: 45617
diff changeset
133
38608
6649b51e245f forgot to add this file in previous commit
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
134 def test_suite():
6649b51e245f forgot to add this file in previous commit
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
135 suite = unittest.TestSuite()
6649b51e245f forgot to add this file in previous commit
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
136 if db.version() >= (4,3):
6649b51e245f forgot to add this file in previous commit
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
137 suite.addTest(unittest.makeSuite(DBSequenceTest))
6649b51e245f forgot to add this file in previous commit
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
138 return suite
6649b51e245f forgot to add this file in previous commit
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
139
6649b51e245f forgot to add this file in previous commit
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
140
6649b51e245f forgot to add this file in previous commit
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
141 if __name__ == '__main__':
6649b51e245f forgot to add this file in previous commit
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff changeset
142 unittest.main(defaultTest='test_suite')