]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
pyldb: Add test for an invalid ldb.Message index type
authorJoseph Sutton <josephsutton@catalyst.net.nz>
Sat, 25 Sep 2021 01:22:05 +0000 (13:22 +1200)
committerStefan Metzmacher <metze@samba.org>
Thu, 28 Oct 2021 08:58:16 +0000 (08:58 +0000)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14845
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14848

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit b018e51d2725a23b2fedd3058644b8021f6a6a06)

lib/ldb/tests/python/api.py
selftest/knownfail.d/pyldb [new file with mode: 0644]

index 1d3d765e607478da6c9e1058af1dd41cc15df946..bcb01e15f56dafc5c757b6c056fe6aa68f7d24f3 100755 (executable)
@@ -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 (file)
index 0000000..8d24c45
--- /dev/null
@@ -0,0 +1 @@
+^ldb.python.api.LdbMsgTests.test_invalid