summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_bsddb.py
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2007-08-05 15:39:16 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2007-08-05 15:39:16 (GMT)
commit64ce5052e1c2495bcbc78f732e8ece2f4c8375ac (patch)
treebe92ddb8c857ddb4a0cd06439c025243d71ad403 /Lib/test/test_bsddb.py
parent33d2689fc900a814f0a7d2f846abe0c34024ae17 (diff)
downloadcpython-64ce5052e1c2495bcbc78f732e8ece2f4c8375ac.zip
cpython-64ce5052e1c2495bcbc78f732e8ece2f4c8375ac.tar.gz
cpython-64ce5052e1c2495bcbc78f732e8ece2f4c8375ac.tar.bz2
Make bsddb use bytes as keys and values. Add StringKeys
and StringValues classes. Fix test suite.
Diffstat (limited to 'Lib/test/test_bsddb.py')
-rwxr-xr-xLib/test/test_bsddb.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/Lib/test/test_bsddb.py b/Lib/test/test_bsddb.py
index 7413307..2da40453 100755
--- a/Lib/test/test_bsddb.py
+++ b/Lib/test/test_bsddb.py
@@ -12,8 +12,12 @@ from test import test_support
class TestBSDDB(unittest.TestCase):
openflag = 'c'
+ def do_open(self, *args, **kw):
+ # openmethod is a list so that it's not mistaken as an instance method
+ return bsddb.StringValues(bsddb.StringKeys(self.openmethod[0](*args, **kw)))
+
def setUp(self):
- self.f = self.openmethod[0](self.fname, self.openflag, cachesize=32768)
+ self.f = self.do_open(self.fname, self.openflag, cachesize=32768)
self.d = dict(q='Guido', w='van', e='Rossum', r='invented', t='Python', y='')
for k, v in self.d.items():
self.f[k] = v
@@ -47,7 +51,7 @@ class TestBSDDB(unittest.TestCase):
# so finish here.
return
self.f.close()
- self.f = self.openmethod[0](self.fname, 'w')
+ self.f = self.do_open(self.fname, 'w')
for k, v in self.d.items():
self.assertEqual(self.f[k], v)