summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Sutton <josephsutton@catalyst.net.nz>2021-09-25 13:22:05 +1200
committerStefan Metzmacher <metze@samba.org>2021-10-26 12:00:28 +0000
commita78c94440be47741f6c0d81d766af64055833da2 (patch)
treeb24050249333a6be958807dadbdbe26e08daf305
parente37949faf918a960292a8cb48265427defcbe557 (diff)
downloadsamba-a78c94440be47741f6c0d81d766af64055833da2.tar.gz
pyldb: Add test for an invalid ldb.Message index type
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14845 Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> (cherry picked from commit b018e51d2725a23b2fedd3058644b8021f6a6a06)
-rwxr-xr-xlib/ldb/tests/python/api.py6
-rw-r--r--selftest/knownfail.d/pyldb1
2 files changed, 7 insertions, 0 deletions
diff --git a/lib/ldb/tests/python/api.py b/lib/ldb/tests/python/api.py
index 1d3d765e607..bcb01e15f56 100755
--- a/lib/ldb/tests/python/api.py
+++ b/lib/ldb/tests/python/api.py
@@ -3056,6 +3056,12 @@ class LdbMsgTests(TestCase):
def test_notpresent(self):
self.assertRaises(KeyError, lambda: self.msg["foo"])
+ def test_invalid(self):
+ try:
+ self.assertRaises(TypeError, lambda: self.msg[42])
+ except KeyError:
+ self.fail()
+
def test_del(self):
del self.msg["foo"]
diff --git a/selftest/knownfail.d/pyldb b/selftest/knownfail.d/pyldb
new file mode 100644
index 00000000000..8d24c4515d3
--- /dev/null
+++ b/selftest/knownfail.d/pyldb
@@ -0,0 +1 @@
+^ldb.python.api.LdbMsgTests.test_invalid