def test_nonexistant_read(self):
self.assertRaises(IOError, tdb.Tdb, "/some/nonexistant/file", 0, tdb.DEFAULT, os.O_RDWR)
+class CloseTdbTests(TestCase):
+ def test_double_close(self):
+ self.tdb = tdb.Tdb(tempfile.mkstemp()[1], 0, tdb.DEFAULT, os.O_CREAT|os.O_RDWR)
+ self.assertNotEqual(None, self.tdb)
+
+ # ensure that double close does not crash python
+ self.tdb.close()
+ self.tdb.close()
+
class SimpleTdbTests(TestCase):
def setUp(self):