summaryrefslogtreecommitdiffstats
path: root/Lib/bsddb/test/test_dbtables.py
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2002-11-23 11:26:07 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2002-11-23 11:26:07 (GMT)
commitb2c7affbaab984915b9401105334afffeedf706d (patch)
tree0ba16241339e317dd0dc2ecbd65abaa6a9f8f40e /Lib/bsddb/test/test_dbtables.py
parenta797d8150dd6fd8336653d8e91db3c088f2c53ff (diff)
downloadcpython-b2c7affbaab984915b9401105334afffeedf706d.zip
cpython-b2c7affbaab984915b9401105334afffeedf706d.tar.gz
cpython-b2c7affbaab984915b9401105334afffeedf706d.tar.bz2
Merge with bsddb3 2002.11.23.10.42.36
Diffstat (limited to 'Lib/bsddb/test/test_dbtables.py')
-rw-r--r--Lib/bsddb/test/test_dbtables.py35
1 files changed, 35 insertions, 0 deletions
diff --git a/Lib/bsddb/test/test_dbtables.py b/Lib/bsddb/test/test_dbtables.py
index 9809945..a346585 100644
--- a/Lib/bsddb/test/test_dbtables.py
+++ b/Lib/bsddb/test/test_dbtables.py
@@ -5,6 +5,7 @@
#-----------------------------------------------------------------------
#
# Copyright (C) 2000, 2001 by Autonomous Zone Industries
+# Copyright (C) 2002 Gregory P. Smith
#
# March 20, 2000
#
@@ -159,6 +160,40 @@ class TableDBTestCase(unittest.TestCase):
assert values[0]['b'] == "bad"
+ def test04_MultiCondSelect(self):
+ tabname = "test04_MultiCondSelect"
+ try:
+ self.tdb.Drop(tabname)
+ except dbtables.TableDBError:
+ pass
+ self.tdb.CreateTable(tabname, ['a', 'b', 'c', 'd', 'e'])
+
+ try:
+ self.tdb.Insert(tabname, {'a': "", 'e': pickle.dumps([{4:5, 6:7}, 'foo'], 1), 'f': "Zero"})
+ assert 0
+ except dbtables.TableDBError:
+ pass
+
+ self.tdb.Insert(tabname, {'a': "A", 'b': "B", 'c': "C", 'd': "D", 'e': "E"})
+ self.tdb.Insert(tabname, {'a': "-A", 'b': "-B", 'c': "-C", 'd': "-D", 'e': "-E"})
+ self.tdb.Insert(tabname, {'a': "A-", 'b': "B-", 'c': "C-", 'd': "D-", 'e': "E-"})
+
+ if verbose:
+ self.tdb._db_print()
+
+ # This select should return 0 rows. it is designed to test
+ # the bug identified and fixed in sourceforge bug # 590449
+ # (Big Thanks to "Rob Tillotson (n9mtb)" for tracking this down
+ # and supplying a fix!! This one caused many headaches to say
+ # the least...)
+ values = self.tdb.Select(tabname, ['b', 'a', 'd'],
+ conditions={'e': dbtables.ExactCond('E'),
+ 'a': dbtables.ExactCond('A'),
+ 'd': dbtables.PrefixCond('-')
+ } )
+ assert len(values) == 0, values
+
+
def test_CreateOrExtend(self):
tabname = "test_CreateOrExtend"