Merge lp:~vijit.chauhan/beeseek/fix-607076 into lp:beeseek
Proposed by
vSC
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Andrea Corbellini | ||||
Approved revision: | 74 | ||||
Merged at revision: | 75 | ||||
Proposed branch: | lp:~vijit.chauhan/beeseek/fix-607076 | ||||
Merge into: | lp:beeseek | ||||
Diff against target: |
60 lines (+30/-2) 2 files modified
node/bsnode/http.py (+8/-2) tests/node/http.py (+22/-0) |
||||
To merge this branch: | bzr merge lp:~vijit.chauhan/beeseek/fix-607076 | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Andrea Corbellini | Approve | ||
Review via email: mp+31325@code.launchpad.net |
Description of the change
Fix for bug 607076
To post a comment you must log in.
Your code is almost perfect, there are few and easy things to fix.
The major issue is that you are using tabs. You should instead use 4
spaces for indentation, like the rest of the code. This is the cause
of two of the exceptions you are seeing while running the test suite.
On Thu, Jul 29, 2010 at 10:23 PM, vSC <email address hidden> wrote: bytes, 16) bytes, 16)
> ...
> - remaining_bytes = int(remaining_
> + try:
> + remaining_bytes = int(remaining_
> + except ValueError:
> + raise HttpError('400 BAD REQUEST')
Here it'd be better to use '400 Bad Request' (capitalized, not upper
case), just to be consistent with the rest of the code).
> ... chunk_size( self): socketpair( );
> + def test_invalid_
> + client, server = socket.
> + client.sendall(
> + 'GET / HTTP/1.1 \r\n'
You ought to use PUT or POST instead of GET, otherwise the content
will be ignored. Also, you must remove the blank space between
'HTTP/1.1' and '\r\n': this is the cause of the third error in the
test suite.
> + 'Host: localhost\r\n'
> + 'Transfer-Encoding: chunked\r\n'
After this you must put a '\r\n' to indicate that headers are finished.
> + 's\r\n' parse_request( ) l(error, ('400 Bad Request'))
> + '1234')
> + def callback(handler):
> + yield handler.
> + try:
> + yield handler.read()
> + except HttpError as err:
> + self.assertEqua
The right line is:
self.assertEqua l(err.args, ('400 Bad Request',))
Note the last comma: it's very important in Python.
> + else: server, callback, ()) incoming_ bytes()
> + self.fail()
> +
> + conn = HttpConnection(
> + conn.handle_
You should de-indent this last two lines.
These are just minor issues (that I can fix for you if you prefer) so
I'm approving the merge proposal. Great work, thanks!