summaryrefslogtreecommitdiff
path: root/source4/lib/ldb/tests/python
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2009-08-26 15:59:00 +1000
committerAndrew Bartlett <abartlet@samba.org>2009-08-26 15:59:00 +1000
commit425386ff6141bba2e7b1d8f3c27e96aaf1c5cb95 (patch)
tree645da53767294cab003826df87a2502505c798b5 /source4/lib/ldb/tests/python
parent3ed33813bb6aa1ca932372c2a2ce36152b6af50b (diff)
downloadsamba-425386ff6141bba2e7b1d8f3c27e96aaf1c5cb95.tar.gz
samba-425386ff6141bba2e7b1d8f3c27e96aaf1c5cb95.tar.bz2
samba-425386ff6141bba2e7b1d8f3c27e96aaf1c5cb95.zip
s4:ldb Add ldb_ldif_write_string() and python wrappers
This allows us to turn a python LdbMessage back into a string. Andrew Bartlett
Diffstat (limited to 'source4/lib/ldb/tests/python')
-rwxr-xr-xsource4/lib/ldb/tests/python/api.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/source4/lib/ldb/tests/python/api.py b/source4/lib/ldb/tests/python/api.py
index 9bcb225190..88983ac738 100755
--- a/source4/lib/ldb/tests/python/api.py
+++ b/source4/lib/ldb/tests/python/api.py
@@ -402,7 +402,9 @@ class DnTests(unittest.TestCase):
msg = msgs.next()
self.assertEquals("foo=bar", str(msg[1].dn))
self.assertTrue(isinstance(msg[1], ldb.Message))
-
+ ldif = self.ldb.write_ldif(msg[1], ldb.CHANGETYPE_NONE)
+ self.assertEquals("dn: foo=bar\n\n", ldif)
+
def test_parse_ldif_more(self):
msgs = self.ldb.parse_ldif("dn: foo=bar\n\n\ndn: bar=bar")
msg = msgs.next()