cheroot.test.test_makefile module#
Tests for cheroot.makefile.
- class cheroot.test.test_makefile.MockSocket#
Bases:
objectA mock socket.
- _decref_socketios()#
Emulate socket I/O reference decrement.
- recv(size)#
Simulate
recvfor Python 2.
- recv_into(buf)#
Simulate
recv_intofor Python 3.
- send(val)#
Simulate a send.
- cheroot.test.test_makefile.test_bytes_read()#
Reader should capture bytes read.
- cheroot.test.test_makefile.test_bytes_written()#
Writer should capture bytes written.
- cheroot.test.test_makefile.test_read_on_nonblocking_socket_with_no_data()#
Reader should return
None, not crash, if nothing is available yet.A non-blocking socket’s
read()can returnNoneper the documentedio.RawIOBasecontract when no data is available; this used to blow up onlen(None). Ref: cherrypy/cheroot#278