summaryrefslogtreecommitdiff
path: root/lib/ldb/tests
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2011-07-28 17:03:06 +1000
committerAndrew Tridgell <tridge@samba.org>2011-07-29 18:17:44 +1000
commit7ce4aca029473b219d053221ced1e3686ce2d3ad (patch)
tree90b75e6de4c32f9e27039d818c0ed8cfff8594a3 /lib/ldb/tests
parentd815ce094e7a495fb2ddf0668015c5a1b9bb1dc4 (diff)
downloadsamba-7ce4aca029473b219d053221ced1e3686ce2d3ad.tar.gz
samba-7ce4aca029473b219d053221ced1e3686ce2d3ad.tar.bz2
samba-7ce4aca029473b219d053221ced1e3686ce2d3ad.zip
pyldb: added binary_encode() and binary_decode() methods
this gives access to RFC2254 encoding from python Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org> Pair-Programmed-With: Amitay Isaacs <amitay@gmail.com>
Diffstat (limited to 'lib/ldb/tests')
-rwxr-xr-xlib/ldb/tests/python/api.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/ldb/tests/python/api.py b/lib/ldb/tests/python/api.py
index bd10b0b293..6a8df25b7b 100755
--- a/lib/ldb/tests/python/api.py
+++ b/lib/ldb/tests/python/api.py
@@ -30,6 +30,10 @@ class NoContextTests(unittest.TestCase):
self.assertEquals(0, ldb.string_to_time("19700101000000.0Z"))
self.assertEquals(1195499412, ldb.string_to_time("20071119191012.0Z"))
+ def test_binary_encode(self):
+ encoded = self.binary_encode('test\\x')
+ decoded = self.binary_decode(encoded)
+ self.assertEquals(decoded, 'test\\x')
class SimpleLdb(unittest.TestCase):