From 628c66a15c22da48bb05c3208bfd146da16338d8 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 24 Dec 2010 11:11:45 +0100 Subject: [PATCH] s4:ldb:python/api: use filename() instead of hardcoded filenames This makes sure we use files under $SELFTEST_PREFIX instead of the source directory. metze --- source4/lib/ldb/tests/python/api.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/source4/lib/ldb/tests/python/api.py b/source4/lib/ldb/tests/python/api.py index 74de70769b3..6c1cb4cac25 100755 --- a/source4/lib/ldb/tests/python/api.py +++ b/source4/lib/ldb/tests/python/api.py @@ -60,7 +60,7 @@ class SimpleLdb(unittest.TestCase): self.assertEquals([], x.modules()) def test_modules_tdb(self): - x = ldb.Ldb("bar.ldb") + x = ldb.Ldb(filename()) self.assertEquals("[]", repr(x.modules())) def test_search(self): @@ -80,7 +80,7 @@ class SimpleLdb(unittest.TestCase): self.assertEquals(len(l.search("", ldb.SCOPE_SUBTREE, "(dc=*)", ["dc"])), 0) def test_search_attr_string(self): - l = ldb.Ldb("foo.tdb") + l = ldb.Ldb(filename()) self.assertRaises(TypeError, l.search, attrs="dc") def test_opaque(self): @@ -626,13 +626,14 @@ class ModuleTests(unittest.TestCase): def search(self, *args, **kwargs): return self.next.search(*args, **kwargs) + name = filename() ldb.register_module(ExampleModule) - if os.path.exists("usemodule.ldb"): - os.unlink("usemodule.ldb") - l = ldb.Ldb("usemodule.ldb") + if os.path.exists(name): + os.unlink(name) + l = ldb.Ldb(name) l.add({"dn": "@MODULES", "@LIST": "bla"}) self.assertEquals([], ops) - l = ldb.Ldb("usemodule.ldb") + l = ldb.Ldb(name) self.assertEquals(["init"], ops) -- 2.11.4.GIT