]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
ldb:tests:api_misc: fix Control test
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Sat, 17 Aug 2024 06:08:09 +0000 (18:08 +1200)
committerAndreas Schneider <asn@cryptomilk.org>
Tue, 24 Sep 2024 09:14:38 +0000 (09:14 +0000)
`self.assertRaises(TypeError, ldb.Control, ldb, 1234)` is raising a
TypeError because `ldb` is not an ldb.Ldb object, it is the ldb module.

What we want to test here is that the non-string `1234` raises a
TypeError -- the previous line tests the type of the ldb argument.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
lib/ldb/tests/python/api_misc.py

index 5b36342ed52faa4cf6cee947b58bdb80146070b8..d855e04832499e6a38f6af4fd138f38ba6981cf8 100644 (file)
@@ -998,7 +998,7 @@ class BadTypeTests(TestCase):
     def test_control(self):
         l = ldb.Ldb()
         self.assertRaises(TypeError, ldb.Control, '<bad type>', 'relax:1')
-        self.assertRaises(TypeError, ldb.Control, ldb, 1234)
+        self.assertRaises(TypeError, ldb.Control, l, 1234)
 
     def test_modify(self):
         l = ldb.Ldb()