X-Git-Url: http://git.samba.org/samba.git/?p=kai%2Fsamba.git;a=blobdiff_plain;f=lib%2Ftdb%2Fpython%2Ftests%2Fsimple.py;h=c7443c0d433526054190c6ce80d66e4866196cb9;hp=d242e665beb971c0934ed5e7143d8d445e51cb56;hb=71a21393dd1bb61bded82b1581ac6d5bd3b0153c;hpb=b4424f8234a78a79fb2d71d46ca208b4f12e0f9e diff --git a/lib/tdb/python/tests/simple.py b/lib/tdb/python/tests/simple.py index d242e665beb..c7443c0d433 100644 --- a/lib/tdb/python/tests/simple.py +++ b/lib/tdb/python/tests/simple.py @@ -15,6 +15,15 @@ class OpenTdbTests(TestCase): 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):