Constant time ObjectClass handling
Jelmer Vernooij
jelmer at samba.org
Mon Mar 26 07:14:44 MDT 2012
On Mon, Mar 26, 2012 at 11:54:42AM +1100, Andrew Bartlett wrote:
> On Sun, 2012-03-25 at 23:42 +0200, Matthias Dieter Wallnöfer wrote:
[...]
> Anyway, attached is my attempted patch, and a patch to ldap.py to get
> out a bit more error information, in case it helps.
Note that you can specify extra error information to assertEquals,
which will cause it to be reported as part of the assertion (so you
don't have to skim through the output later nor always see that error
string.
E.g. :
self.assertEquals(num, ERR_UNWILLING_TO_PERFORM,
"errstring: %s" % errstring)
Cheers,
Jelmer
> diff --git a/source4/dsdb/tests/python/ldap.py b/source4/dsdb/tests/python/ldap.py
> index 5ca4c26..70005fc 100755
> --- a/source4/dsdb/tests/python/ldap.py
> +++ b/source4/dsdb/tests/python/ldap.py
> @@ -150,7 +150,8 @@ class BasicTests(samba.tests.TestCase):
> "dn": "cn=ldaptestuser,cn=users," + self.base_dn,
> "objectClass": "connectionPoint" })
> self.fail()
> - except LdbError, (num, _):
> + except LdbError, (num, errstring):
> + print errstring
> self.assertEquals(num, ERR_UNWILLING_TO_PERFORM)
> try:
> self.ldb.add({
> @@ -558,7 +559,8 @@ class BasicTests(samba.tests.TestCase):
> "dn": "ou=testou,cn=users," + self.base_dn,
> "objectclass": "organizationalUnit"})
> self.fail()
> - except LdbError, (num, _):
> + except LdbError, (num, errstring):
> + print errstring
> self.assertEquals(num, ERR_NAMING_VIOLATION)
>
> delete_force(self.ldb, "ou=testou,cn=users," + self.base_dn)
Cheers,
Jelmer
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20120326/43976bd0/attachment.pgp>
More information about the samba-technical
mailing list