summaryrefslogtreecommitdiff
path: root/source4/scripting/python/samba/tests/__init__.py
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2007-12-25 16:36:44 -0600
committerStefan Metzmacher <metze@samba.org>2007-12-26 11:57:08 -0600
commit533cc583ed20efdfd6bee60f86d16fef3942898b (patch)
treeb89f9b0988d38e9995a71ff8d14ea023cc37783a /source4/scripting/python/samba/tests/__init__.py
parentcea31e32163fe639be72b3f4dfca1362c93b5576 (diff)
downloadsamba-533cc583ed20efdfd6bee60f86d16fef3942898b.tar.gz
samba-533cc583ed20efdfd6bee60f86d16fef3942898b.tar.bz2
samba-533cc583ed20efdfd6bee60f86d16fef3942898b.zip
r26596: Fixed upgrade.py.
Added blackbox tests for provision and upgrade Python scripts. Clean up temporary files created by the Python tests. (This used to be commit 2227fb6df62240cae64d27a1920d878316f819fc)
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 5885a3b5079..5e1ff87c2b5 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)