pythonbindings: allow add() to have an array of controls as second parameter
[ira/wip.git] / source4 / lib / ldb / tests / python / api.py
index 133bd180c17b1275315f182f62e8ccb2380da6b2..956908d7d6946e26f53b400678da4f7a1f5cb1da 100755 (executable)
@@ -136,6 +136,14 @@ class SimpleLdb(unittest.TestCase):
         finally:
             l.delete(ldb.Dn(l, "dc=foo4"))
 
+    def test_add_w_unhandled_ctrl(self):
+        l = ldb.Ldb(filename())
+        m = ldb.Message()
+        m.dn = ldb.Dn(l, "dc=foo4")
+        m["bla"] = "bla"
+        self.assertEquals(len(l.search()), 1)
+        self.assertRaises(ldb.LdbError, lambda: l.add(m,["search_options:1:2"]))
+
     def test_add_dict(self):
         l = ldb.Ldb(filename())
         m = {"dn": ldb.Dn(l, "dc=foo5"),