From: Douglas Bagnall Date: Sat, 17 Aug 2024 06:08:09 +0000 (+1200) Subject: ldb:tests:api_misc: fix Control test X-Git-Tag: tdb-1.4.13~1170 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ccc732dae294351e7c5caeb779be70e7afbf6139;p=thirdparty%2Fsamba.git ldb:tests:api_misc: fix Control test `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 Reviewed-by: Andreas Schneider --- diff --git a/lib/ldb/tests/python/api_misc.py b/lib/ldb/tests/python/api_misc.py index 5b36342ed52..d855e048324 100644 --- a/lib/ldb/tests/python/api_misc.py +++ b/lib/ldb/tests/python/api_misc.py @@ -998,7 +998,7 @@ class BadTypeTests(TestCase): def test_control(self): l = ldb.Ldb() self.assertRaises(TypeError, ldb.Control, '', 'relax:1') - self.assertRaises(TypeError, ldb.Control, ldb, 1234) + self.assertRaises(TypeError, ldb.Control, l, 1234) def test_modify(self): l = ldb.Ldb()