add helper class to analyze response.location - #276
Conversation
3c1d374 to
201ff16
Compare
gawel
left a comment
There was a problem hiding this comment.
This project respect PEP8 80 char but you patch is not. Can you reformat your code ?
Can you also add a few doc strings/docs ? Maybe in docs/testresponse.rst
| return self._response.headers.getall(headers) | ||
|
|
||
|
|
||
| class Error: |
There was a problem hiding this comment.
Can you choose a more specific name ? Maybe URLMissMatch ?
There was a problem hiding this comment.
Ok changed for URLMismatch.
| errors.append(f'?{key}={value} was not expected.') | ||
|
|
||
| if errors: | ||
| return Error(' '.join(errors)) |
There was a problem hiding this comment.
You can avoid this if and always return an object if Error.__bool__ is conditional
a7589f1 to
99baf06
Compare
It does not seem the case in tests/test_utils.py but ok.
Yep done. |
99baf06 to
30c3a47
Compare
|
LGTM. Thanks. I'll wait a few days before the merge in case someone wants to react |
Suggestion by @gawel, a new webtest.utils.URL class used to return response.location/content_location/url and simplify tests, with pytest you can write things as simple as:
and you get clear errors on output