[python-ldap] [PATCH] Tests for the ldif module
pviktori at redhat.com
Fri Oct 2 15:28:54 CEST 2015
On 09/30/2015 07:23 PM, Michael Ströder wrote:
> Petr Viktorin wrote:
>> I've written some basic tests for the ldif module.
> I had to restructure this a bit because the LDIF string representations are
> ambigous. So you can only compare the parsed structures.
They are ambiguous, but hopefully the LDIFWriter output is stable (in
the sense that the same records produce the same LDIF output). This is
not a required property, but would be nice if it held.
The original tests always compared either parsed structures or the
LDIFWriter output. The third argument to check_roundtrip() was this
"normalized" LDIF (in case it was different from the input).
This meant tests would break on any change to the output format (not
just changes incompatible with the parser), allowing you to inspect if
it was intended.
Your call: should the LDIFParser+LDIFWriter combination do normalization?
Revert patch attached, should you want to use it. It preserves the
recently added "attr::b64val" test, and adds a new corner case
("attr:\n", as opposed to "attr: \n").
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 5546 bytes
Desc: not available
More information about the python-ldap