From 7ce4aca029473b219d053221ced1e3686ce2d3ad Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 28 Jul 2011 17:03:06 +1000 Subject: pyldb: added binary_encode() and binary_decode() methods this gives access to RFC2254 encoding from python Pair-Programmed-With: Andrew Bartlett Pair-Programmed-With: Amitay Isaacs --- lib/ldb/tests/python/api.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/ldb/tests') 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): -- cgit