diff options
author | Gregory P. Smith <greg@mad-scientist.com> | 2007-08-24 05:32:10 (GMT) |
---|---|---|
committer | Gregory P. Smith <greg@mad-scientist.com> | 2007-08-24 05:32:10 (GMT) |
commit | 07aec08a0134318a5ee087e61f5afbb213f77d93 (patch) | |
tree | a38212884336cec47a890ac4ffd4f74689fc9278 /Lib/test | |
parent | fc5fafcf78c87ff80b79a9b89cee7b0e2add6186 (diff) | |
download | cpython-07aec08a0134318a5ee087e61f5afbb213f77d93.zip cpython-07aec08a0134318a5ee087e61f5afbb213f77d93.tar.gz cpython-07aec08a0134318a5ee087e61f5afbb213f77d93.tar.bz2 |
reapply of r57378 to fix bug 1725856
Diffstat (limited to 'Lib/test')
-rwxr-xr-x | Lib/test/test_bsddb.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/Lib/test/test_bsddb.py b/Lib/test/test_bsddb.py index 2da40453..dfee3dc 100755 --- a/Lib/test/test_bsddb.py +++ b/Lib/test/test_bsddb.py @@ -131,6 +131,22 @@ class TestBSDDB(unittest.TestCase): items.append(self.f.previous()) self.assertSetEquals(items, self.d.items()) + def test_first_while_deleting(self): + # Test for bug 1725856 + self.assert_(len(self.d) >= 2, "test requires >=2 items") + for _ in self.d: + key = self.f.first()[0] + del self.f[key] + self.assertEqual(0, len(self.f), "expected empty db after test") + + def test_last_while_deleting(self): + # Test for bug 1725856's evil twin + self.assert_(len(self.d) >= 2, "test requires >=2 items") + for _ in self.d: + key = self.f.last()[0] + del self.f[key] + self.assertEqual(0, len(self.f), "expected empty db after test") + def test_set_location(self): self.assertEqual(self.f.set_location('e'), ('e', self.d['e'])) |