summaryrefslogtreecommitdiff
path: root/source4/scripting/python/samba/tests/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'source4/scripting/python/samba/tests/__init__.py')
-rw-r--r--source4/scripting/python/samba/tests/__init__.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/source4/scripting/python/samba/tests/__init__.py b/source4/scripting/python/samba/tests/__init__.py
index 5885a3b507..5e1ff87c2b 100644
--- a/source4/scripting/python/samba/tests/__init__.py
+++ b/source4/scripting/python/samba/tests/__init__.py
@@ -67,7 +67,12 @@ class SubstituteVarTestCase(unittest.TestCase):
class LdbExtensionTests(TestCaseInTempDir):
def test_searchone(self):
- l = samba.Ldb(self.tempdir + "/searchone.ldb")
- l.add({"dn": "foo=dc", "bar": "bla"})
- self.assertEquals("bla", l.searchone(ldb.Dn(l, "foo=dc"), "bar"))
+ path = self.tempdir + "/searchone.ldb"
+ l = samba.Ldb(path)
+ try:
+ l.add({"dn": "foo=dc", "bar": "bla"})
+ self.assertEquals("bla", l.searchone(ldb.Dn(l, "foo=dc"), "bar"))
+ finally:
+ del l
+ os.unlink(path)