summaryrefslogtreecommitdiff
path: root/Lib/test/test_bsddb.py
diff options
context:
space:
mode:
authorGregory P. Smith <greg@mad-scientist.com>2006-04-12 20:16:56 +0000
committerGregory P. Smith <greg@mad-scientist.com>2006-04-12 20:16:56 +0000
commit14c6b4626f4e06a28a043bc41737389cd3951181 (patch)
treebfc423f1fe0689864f47102a5be03fa6bed6ff5d /Lib/test/test_bsddb.py
parent55d031ef23ac8f6e7cfe823f62c9e4f627e7b431 (diff)
downloadcpython-git-14c6b4626f4e06a28a043bc41737389cd3951181.tar.gz
Closes bug #1149413
Using None for a filename with the 'n' flag when calling bsddb.btopen would cause an error while checking if the file None existed. error not likely to be seen as anyone using None for a filename would likely use the 'c' flag in the first place.
Diffstat (limited to 'Lib/test/test_bsddb.py')
-rwxr-xr-xLib/test/test_bsddb.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/Lib/test/test_bsddb.py b/Lib/test/test_bsddb.py
index 1ec4801049..7a0c97c172 100755
--- a/Lib/test/test_bsddb.py
+++ b/Lib/test/test_bsddb.py
@@ -11,9 +11,10 @@ from test import test_support
from sets import Set
class TestBSDDB(unittest.TestCase):
+ openflag = 'c'
def setUp(self):
- self.f = self.openmethod[0](self.fname, 'c')
+ self.f = self.openmethod[0](self.fname, self.openflag)
self.d = dict(q='Guido', w='van', e='Rossum', r='invented', t='Python', y='')
for k, v in self.d.iteritems():
self.f[k] = v
@@ -267,6 +268,11 @@ class TestBTree_InMemory(TestBSDDB):
fname = None
openmethod = [bsddb.btopen]
+class TestBTree_InMemory_Truncate(TestBSDDB):
+ fname = None
+ openflag = 'n'
+ openmethod = [bsddb.btopen]
+
class TestHashTable(TestBSDDB):
fname = test_support.TESTFN
openmethod = [bsddb.hashopen]
@@ -285,6 +291,7 @@ def test_main(verbose=None):
TestHashTable,
TestBTree_InMemory,
TestHashTable_InMemory,
+ TestBTree_InMemory_Truncate,
)
if __name__ == "__main__":