summaryrefslogtreecommitdiff
path: root/source4/lib/ldb/tests
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2008-01-11 00:23:33 +0100
committerJelmer Vernooij <jelmer@samba.org>2008-01-11 01:04:25 +0100
commit9269db983d847be7a0cdc9eb2bcc4ebe3066be1c (patch)
tree4d6124d8acf980bccc1e4e7022bd9e0d3fa7a91d /source4/lib/ldb/tests
parent4f6177da78d0da64c1cda23bd7a176cfe2e6e140 (diff)
downloadsamba-9269db983d847be7a0cdc9eb2bcc4ebe3066be1c.tar.gz
samba-9269db983d847be7a0cdc9eb2bcc4ebe3066be1c.tar.bz2
samba-9269db983d847be7a0cdc9eb2bcc4ebe3066be1c.zip
python/ldb: Add __getitem__ implementation for LdbMessageElement.
(This used to be commit e6498a0780dd31dfc623a69432004b606aeaccbe)
Diffstat (limited to 'source4/lib/ldb/tests')
-rwxr-xr-xsource4/lib/ldb/tests/python/api.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/source4/lib/ldb/tests/python/api.py b/source4/lib/ldb/tests/python/api.py
index d9dfce8718..0a5ba035ff 100755
--- a/source4/lib/ldb/tests/python/api.py
+++ b/source4/lib/ldb/tests/python/api.py
@@ -382,6 +382,12 @@ class MessageElementTests(unittest.TestCase):
x = ldb.MessageElement(["foo"])
self.assertEquals(["foo"], list(x))
+ def test_get_item(self):
+ x = ldb.MessageElement(["foo", "bar"])
+ self.assertEquals("foo", x[0])
+ self.assertEquals("bar", x[1])
+ self.assertRaises(KeyError, lambda: x[-1])
+
class ExampleModule:
name = "example"