summaryrefslogtreecommitdiff
path: root/source4/lib/ldb/tests/python
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2010-12-24 11:11:45 +0100
committerStefan Metzmacher <metze@samba.org>2010-12-24 17:31:06 +0100
commit628c66a15c22da48bb05c3208bfd146da16338d8 (patch)
tree0cc24492122fd5aff361b43804794b6229ad18af /source4/lib/ldb/tests/python
parentebb4af9d35c5cddef4a9f9028761341a4f3437a3 (diff)
downloadsamba-628c66a15c22da48bb05c3208bfd146da16338d8.tar.gz
samba-628c66a15c22da48bb05c3208bfd146da16338d8.tar.bz2
samba-628c66a15c22da48bb05c3208bfd146da16338d8.zip
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
Diffstat (limited to 'source4/lib/ldb/tests/python')
-rwxr-xr-xsource4/lib/ldb/tests/python/api.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/source4/lib/ldb/tests/python/api.py b/source4/lib/ldb/tests/python/api.py
index 74de70769b..6c1cb4cac2 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("[<ldb module 'tdb'>]", 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)