From bb944dcf64aeb308991d6e7fa4da0550b1c86489 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 3 Aug 2009 18:15:16 +0200 Subject: pyldb: Raise proper exception when attempting to assign a string to a dn attribute. --- source4/lib/ldb/tests/python/api.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source4/lib/ldb/tests/python') diff --git a/source4/lib/ldb/tests/python/api.py b/source4/lib/ldb/tests/python/api.py index 05e3da782e..110b1cabfe 100755 --- a/source4/lib/ldb/tests/python/api.py +++ b/source4/lib/ldb/tests/python/api.py @@ -279,6 +279,12 @@ class DnTests(unittest.TestCase): def setUp(self): self.ldb = ldb.Ldb(filename()) + def test_set_dn_invalid(self): + x = ldb.Message() + def assign(): + x.dn = "astring" + self.assertRaises(TypeError, assign) + def test_eq(self): x = ldb.Dn(self.ldb, "dc=foo11,bar=bloe") y = ldb.Dn(self.ldb, "dc=foo11,bar=bloe") -- cgit