From: Douglas Bagnall Date: Wed, 6 Mar 2024 22:09:39 +0000 (+1300) Subject: ldb:pytests: test duplicate connections fail X-Git-Tag: tdb-1.4.11~1406 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d58c2c299dee35bd4fde619481509b31a0ff9215;p=thirdparty%2Fsamba.git ldb:pytests: test duplicate connections fail (they don't yet). Signed-off-by: Douglas Bagnall Reviewed-by: Andrew Bartlett --- diff --git a/lib/ldb/tests/python/api.py b/lib/ldb/tests/python/api.py index 66cbc359372..866bfb0f751 100755 --- a/lib/ldb/tests/python/api.py +++ b/lib/ldb/tests/python/api.py @@ -124,6 +124,20 @@ class SimpleLdb(LdbBaseTest): x = ldb.Ldb() x.connect(self.url(), flags=self.flags()) + def test_connect_twice(self): + url = self.url() + x = ldb.Ldb(url) + with self.assertRaises(ldb.LdbError): + x.connect(url, flags=self.flags()) + + def test_connect_twice_later(self): + url = self.url() + flags = self.flags() + x = ldb.Ldb() + x.connect(url, flags) + with self.assertRaises(ldb.LdbError): + x.connect(url, flags) + def test_repr(self): x = ldb.Ldb() self.assertTrue(repr(x).startswith("