summaryrefslogtreecommitdiff
path: root/source4/lib/ldb/tests/python/api.py
diff options
context:
space:
mode:
Diffstat (limited to 'source4/lib/ldb/tests/python/api.py')
-rwxr-xr-xsource4/lib/ldb/tests/python/api.py15
1 files changed, 14 insertions, 1 deletions
diff --git a/source4/lib/ldb/tests/python/api.py b/source4/lib/ldb/tests/python/api.py
index b140bfc599..b6d6170ec2 100755
--- a/source4/lib/ldb/tests/python/api.py
+++ b/source4/lib/ldb/tests/python/api.py
@@ -1,8 +1,11 @@
#!/usr/bin/python
-# Simple tests for the ldb python API
+# Simple tests for the ldb python bindings.
# Copyright (C) 2007 Jelmer Vernooij <jelmer@samba.org>
+
import sys
import unittest
+
+# Required for the standalone LDB build
sys.path.append("swig")
sys.path.append("build/lib.linux-i686-2.4")
@@ -116,6 +119,16 @@ class SimpleLdb(unittest.TestCase):
finally:
l.delete(ldb.Dn(l, "dc=foo"))
+ def test_add_dict_string_dn(self):
+ l = ldb.Ldb("foo.tdb")
+ m = {"dn": "dc=foo", "bla": "bla"}
+ self.assertEquals(len(l.search()), 1)
+ l.add(m)
+ try:
+ self.assertEquals(len(l.search()), 2)
+ finally:
+ l.delete(ldb.Dn(l, "dc=foo"))
+
def test_rename(self):
l = ldb.Ldb("foo.tdb")
m = ldb.Message()