summaryrefslogtreecommitdiffstats
path: root/Lib/bsddb/test/test_misc.py
diff options
context:
space:
mode:
authorJesus Cea <jcea@jcea.es>2008-07-23 11:38:42 (GMT)
committerJesus Cea <jcea@jcea.es>2008-07-23 11:38:42 (GMT)
commitc5a11fabdb03d032f278f86e600bcdaafdb5d783 (patch)
treee7db234112c7ac06aebe9c1e7833b0dd4168c664 /Lib/bsddb/test/test_misc.py
parent30e208d525cd472446feb91b774cf472e7122918 (diff)
downloadcpython-c5a11fabdb03d032f278f86e600bcdaafdb5d783.zip
cpython-c5a11fabdb03d032f278f86e600bcdaafdb5d783.tar.gz
cpython-c5a11fabdb03d032f278f86e600bcdaafdb5d783.tar.bz2
bsddb module updated to version 4.7.2devel9.
This patch publishes the work done until now for Python 3.0 compatibility. Still a lot to be done. When possible, we use 3.0 features in Python 2.6, easing development and testing, and exposing internal changes to a wider audience, for better test coverage. Some mode details: http://www.jcea.es/programacion/pybsddb.htm#bsddb3-4.7.2
Diffstat (limited to 'Lib/bsddb/test/test_misc.py')
-rw-r--r--Lib/bsddb/test/test_misc.py18
1 files changed, 15 insertions, 3 deletions
diff --git a/Lib/bsddb/test/test_misc.py b/Lib/bsddb/test/test_misc.py
index 1da5830..dce7e0c 100644
--- a/Lib/bsddb/test/test_misc.py
+++ b/Lib/bsddb/test/test_misc.py
@@ -47,6 +47,18 @@ class MiscTestCase(unittest.TestCase):
rp = repr(db)
self.assertEquals(rp, "{}")
+ def test04_repr_db(self) :
+ db = hashopen(self.filename)
+ d = {}
+ for i in xrange(100) :
+ db[repr(i)] = repr(100*i)
+ d[repr(i)] = repr(100*i)
+ db.close()
+ db = hashopen(self.filename)
+ rp = repr(db)
+ self.assertEquals(rp, repr(d))
+ db.close()
+
# http://sourceforge.net/tracker/index.php?func=detail&aid=1708868&group_id=13900&atid=313900
#
# See the bug report for details.
@@ -54,7 +66,7 @@ class MiscTestCase(unittest.TestCase):
# The problem was that make_key_dbt() was not allocating a copy of
# string keys but FREE_DBT() was always being told to free it when the
# database was opened with DB_THREAD.
- def test04_double_free_make_key_dbt(self):
+ def test05_double_free_make_key_dbt(self):
try:
db1 = db.DB()
db1.open(self.filename, None, db.DB_BTREE,
@@ -67,7 +79,7 @@ class MiscTestCase(unittest.TestCase):
db1.close()
os.unlink(self.filename)
- def test05_key_with_null_bytes(self):
+ def test06_key_with_null_bytes(self):
try:
db1 = db.DB()
db1.open(self.filename, None, db.DB_HASH, db.DB_CREATE)
@@ -86,7 +98,7 @@ class MiscTestCase(unittest.TestCase):
db1.close()
os.unlink(self.filename)
- def test_DB_set_flags_persists(self):
+ def test07_DB_set_flags_persists(self):
if db.version() < (4,2):
# The get_flags API required for this to work is only available
# in Berkeley DB >= 4.2