]> 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)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 28 Sep 2021 09:44:35 +0000 (09:44 +0000)
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>
lib/ldb/tests/python/api.py
selftest/knownfail.d/pyldb [new file with mode: 0644]

index 16b71e2e650f745befbf92431f8c3f484803958a..d8a7bd542692532cfe7f51678ba759292857db18 100755 (executable)
@@ -3082,6 +3082,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