treq
treq copied to clipboard
StringStubbingResource docstring is wrong
It says:
:param dict headers: A dictionary of headers mapping header keys to
a list of header values (sorted alphabetically)
While they should be lists, the code actually requires them to be single values, since the code calls setHeader. Using a list will result in the header field having a value of the repr of the list.
The quoted text is discussing the arguments of the callable, but the next paragraph does call out that the return value must not be a list. This doesn't seem like great API design, but the docstring does appear to match the implementation.