diff options
Diffstat (limited to 'Lib/test/test_bsddb.py')
-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 fbe855f..acd4972 100755 --- a/Lib/test/test_bsddb.py +++ b/Lib/test/test_bsddb.py @@ -127,6 +127,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([], self.f.items(), "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([], self.f.items(), "expected empty db after test") + def test_set_location(self): self.assertEqual(self.f.set_location('e'), ('e', self.d['e'])) |