|
[
Permlink
| « Hide
]
Jim Gallacher added a comment - 10/Dec/05 07:49 AM
Martin's patch (md-20051209.diff)
Jim Gallacher made changes - 10/Dec/05 07:49 AM
Should we be unit testing the getters and setters for all request and server object members?
Some of the unit tests fail after applying Martin's patch. Investigating further reveals that request members are being tested in the unit tests but there are several problems.
One failing test is for req.allowed_xmethods != (). I think this may be a problem with test itself as it seems allowed_xmethods returns None. The question remains though: why were the tests not detecting the segfaults detailed in this issue? Modifying util.c so that tuple_from_array_header and tuple_from_method_list return an empty tuple instead of None fixes the problem, but I still have t(o check whether this change won't break anything else.
OK, if we modify tuple_from_array_header and tuple_from_method_list, here are the members that would be defined as an empty tuple rather than a None value when the underlying Apache data is not defined :
server.names server.wildnames req.allowed_xmethods req.allowed_methods req.content_languages I don't know if we should change the behaviour of those members or simply alter the unit tests, though. The req.allowed_xmethods, req.allowed_methods documentation states that these are a tuples. It seems req.content_languages, server.names, server.wild_names are undocumented.
I don't have mod_python 3.1.4 handy to test but certainly the relavent code has not changed since then. If the problem existed there then I don't think we need to worry about changing the return type since nobody would have been able to access these members anyway.
Jim Gallacher made changes - 18/Dec/05 02:32 AM
Graham Dumpleton made changes - 05/Mar/06 03:00 PM
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||