[cse491] send, sendall, non-blocking sockets, and nosetests

Joe Amenta amentajo at msu.edu
Tue Oct 13 11:11:33 PDT 2009


Titus,

While refactoring and testing my code, I ran across a few snags with
your test cases.  For one, when I refactored my code to use send()
instead of sendall(), tests broke; you didn't define that method on
the fake socket objects.  I'm using send() because I want to make sure
that all data gets sent on a non-blocking socket, and the only way to
do that is to send() with error catching until there's no more to 
send(), or so I have read.  Also, you raise an unexpected version of
socket.error, so my less judicious version of "except socket.error"
fails when it shouldn't.  Never fear!  I have modified and attached
versions of the test cases that my correct code passes.

--Joe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test_webserve.py
Type: text/x-python
Size: 3491 bytes
Desc: not available
URL: <http://lists.idyll.org/pipermail/cse491-fall-2009/attachments/20091013/2d82734b/attachment.py>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test_nb_webserve.py
Type: text/x-python
Size: 3331 bytes
Desc: not available
URL: <http://lists.idyll.org/pipermail/cse491-fall-2009/attachments/20091013/2d82734b/attachment-0001.py>


More information about the cse491-fall-2009 mailing list