summaryrefslogtreecommitdiff
path: root/tests/greenio_test.py
Commit message (Collapse)AuthorAgeFilesLines
* Python 3 compat: Fix all Travis test failuresdevJakub Stasiak2015-02-131-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch consists of the following changes: * Splitting eventlet.greenio into base, py2 and py3 parts (eventlet.greenio should be exporing the same public objects). This change is motivated by the size and the number of conditions present in the current greenio code * Connected to the first point: implementing almost completely new GreenPipe callable utilizing parts of old GreenPipe code but dropping _fileobject/SocketIO inheritance in favour of io.FileIO and making use of patched _pyio.open function which wraps raw file-like object in various readers and writers (they take care of the buffering, encoding/decoding etc.) * Implementing (from scratch or updating existing versions) green versions of the following modules: * http.* (needed by Python 3's urllib) * selectors (Python >= 3.4, used in subprocess module) * urllib.* (needed by various tests and we were already exposing green urllib) * Modifying some tests to make tests pass, which includes: * unicode/bytestring issues * modifying wsgi_test_conntimeout.py to not pass bufsize and close arguments to ExplodingSocketFile - on Python 3 it inherits from SocketIO, which doesn't deal with buffering at all as far as I can see * Random cleaning up and reorganizing * Requiring Python 3.x tests to pass for the whole build to pass Known issues: * code repetition * naming inconsistencies * possibly breaking some external code using private eventlet.greenio attributes Closes https://github.com/eventlet/eventlet/issues/108 Affects https://github.com/eventlet/eventlet/issues/6 (I'd call it an experimental support) Should help for https://github.com/eventlet/eventlet/issues/145 Should help for https://github.com/eventlet/eventlet/issues/157
* Python 3 compat: Improve testsJakub Stasiak2015-02-091-11/+15
|
* fix for already closed socketsDavid Szotten2015-02-081-0/+6
|
* Fix string concatenation errorsSteven Hardy2014-11-151-0/+32
| | | | | | | | | | | | Some error paths concatenate the output of "type" with a string, which gives TypeError: cannot concatenate 'str' and 'type' objects, rather than describing the actual error. Closes #149 GH Closes #150 GH Conflicts: eventlet/hubs/twistedr.py
* pep8: trivial fixesChristoph Gysin2014-11-111-1/+1
| | | | Closes #161 (GH)
* Python 3 compat; Improve WSGI, WS, threading and testsJakub Stasiak2014-11-111-6/+6
| | | | | | | | | | | | | | | | | | | This includes: * patching more tests to pass * removing few unit tests which I think are redundant * repeating SSL socket reads in a loop to read all data (I suspect this is related to the fact that writelines is used in the server code there and Python 3 writelines calls write/send repeatedly while on Python 2 it calls it once; on one hand there's no guarantee that single recv/read will return all data sent by the server, on the other hand it's quite suspicious that the number of required reads seems to be connected to the number of sends on the other side of the connection) * working through Python 2/Python 3 threading and thread differences; the lock code I used is the simplest way I could make the tests pass but will likely need to be modified in order to match the original This commit includes 6bcb1dc and closes GH #153
* Fix "maximum recursion depth exceeded in GreenSocket.__del__"Jakub Stasiak2014-10-161-1/+19
| | | | | Closes #137 Closes #148
* Python 3 compat: Improve various bitsJakub Stasiak2014-10-101-6/+6
| | | | | | | | | | | | | | | | | | This includes changes to WSGI, websocket, bytes/str/unicode handling, SSL, backdoor, greenio and tests. Some comments and conditionals (PY2/PY3) were added for clarity GH issues: Closes #106 Closes #111 Closes #118 Closes #141 Incidentally should also close #135 (reopen if didn't) cc #6
* Python 3 compatibility fixesJakub Stasiak2014-07-181-9/+9
| | | | | | Closes GH-102 Closes GH-103 Closes GH-104
* tests: deprecated TestCase.assert_() -> assert keywordSergey Shepelev2014-07-161-11/+11
| | | | https://github.com/eventlet/eventlet/issues/101
* python3 compatibilitySergey Shepelev2014-04-241-62/+75
| | | | | | | | | | | | - __next__ for iterator interface - six.next() to get next item - list(dict.keys()) - popen2.popen4 -> subprocess - s2b -> b"..." literals - deprecated assertEquals -> assertEqual - hub_test test_fork using run_python - 1L -> 1 long literal - many PEP-8 fixes
* pypy compatibilityJakub Stasiak2014-04-151-12/+11
|
* python3 compat fixesVictor Sergeyev2014-03-281-4/+4
| | | | https://github.com/eventlet/eventlet/pull/59
* python3 compat: 2to3: `except E as e:` syntaxDavanum Srinivas2013-12-031-12/+12
| | | | | | | First step to Python 3 compatibility "2to3 -w -f except ." See [1] [1] http://docs.python.org/2/library/2to3.html#fixers
* hubs: kqueue: squashed fixesEdward George2013-06-091-0/+8
| | | | | | | | * try and recover from bad file descriptor error after fork * remove some stuff in kqueue hub that was added by accident * skip test_closure test with kqueue hub kqueue hub cannot detect closures of file descriptors * simplify _reinit_kqueue()
* tests: select socket pair is not writable; Thanks to Yamamoto TakashiSergey Shepelev2013-04-161-1/+7
|
* tests: Improve tox configuration and setup TravisJakub Stasiak2013-04-121-0/+1
|
* greenio: Pre-cache proxied GreenSocket methods; Fixes Bitbucket #136; Thanks ↵Sergey Shepelev2013-02-011-0/+6
| | | | | | to Derk Tegeler https://bitbucket.org/which_linden/eventlet/issue/136
* greenio: socket.dup() made excess fcntl syscalls, added set_nonblocking=True ↵Sergey Shepelev2013-01-241-2/+43
| | | | | | kwarg to skip it; Thanks to Peter Portante https://bitbucket.org/which_linden/eventlet/pull-request/27
* greenio: socket.settimeout(0) then to >0 did not switch back to blocking ↵Sergey Shepelev2013-01-211-0/+23
| | | | | | mode; Thanks to Peter pskirko https://bitbucket.org/which_linden/eventlet/pull-request/15/fix-timeout-bug
* greenio: relative seek() typo _get_readahead_len; Thanks to AlanPSergey Shepelev2012-12-141-0/+2
| | | | https://bitbucket.org/which_linden/eventlet/issue/112
* greenio: pep8, pyflakesSergey Shepelev2012-12-141-63/+76
|
* Fixes #69, thanks to the solid test case and patch. Added a unit test that ↵Ryan Williams2010-12-111-3/+8
| | | | verifies correctness. Thank you!
* Fixes #66. Not super-happy that it doesn't work in epoll, but haven't ↵Ryan Williams2010-11-201-2/+48
| | | | cracked that nut yet.
* Split eventlet.green.socket into two modules to support rtyler's greendns workRyan Williams2010-06-241-1/+0
|
* Added testcases for GreenPipe.seek and truncate, fixed problem with ↵amajorek2010-03-311-23/+79
| | | | GreenPipe(file_name).
* Reimplemented GreenPipe without using file object.amajorek2010-03-301-8/+2
| | | | | | | | file.write is not returning number of bytes writen and partial writes were not handled properly. New implementation is using os module calls which support partial writes. It also implements missing calls from file object (like seek, tell, truncate, ...). The later is not very usefull, because regular files never return EAGAIN. New GreenPipe can be constructed from int, string or file object.
* Added testcase showing broken behavior of GreenPipe object.amajorek2010-03-291-0/+25
| | | | | | write larger PIPE_BUF size 4K or 64K on newer systems will be retried in full instead of continued. I see no way to fix it while using file.write - it does not return written size. os.write does.
* Added multiple-reader prevention code because it seems to be a fairly common ↵Ryan Williams2010-03-151-0/+24
| | | | pitfall. Also added defaults to the debug methods so you can call them no-args to reset them.
* module eventlet.common moved to eventlet.supportamajorek2010-03-091-1/+1
|
* typoamajorek2010-03-021-1/+1
|
* py3k socket send and receives byte type data. They are different from ↵amajorek2010-03-021-24/+23
| | | | | | | | | strings in 3.x. tests.s2b function added to convert string to bytes type on 3.x. No-op on 2.x. / replaced with // used when integer division was intedned. Testing for closed file made portable by changing if data=='': to if not data: ('' != b'') renamed bytes variable, not to clash with 3.x builtin type.
* py3k - 3.x file object returned by socket.makefile does not allow writes if ↵amajorek2010-02-281-13/+18
| | | | | | it was open for reading. Also write to closed file raises exception immediately - it used to raise exception on flush.
* New eventlet.common module to create version-neutral layer. For now only ↵amajorek2010-02-281-0/+1
| | | | | | get_errno added there. All usage of e[0] replaced with either get_errno(e) or e.args[0] if intnetion was not to extract errno, but first argument
* Merge with latest which_linden tipamajorek2010-02-271-54/+106
|\
| * Skipping these tests for now.Ryan Williams2010-02-261-2/+4
| |
| * MergeRyan Williams2010-02-261-6/+109
| |\
| | * fairness and scheduling tests.jmalicki2010-02-221-8/+112
| | |
| * | New module convenience; moved convenience functions in there. Sectioned off ↵Ryan Williams2010-02-251-53/+0
| | | | | | | | | | | | the basic_usage document a little differently to highlight the convenience functions. Wrote a bunch more serve tests.
* | | py3k - extracting errno from exception wrapped into get_errno function to ↵amajorek2010-02-271-1/+1
|/ / | | | | | | | | | | work under 3.x python. Exceptions do not have __getitem__ implemented. e.args[0] still works.
* | First import of Sergey's serve method. Hacked to fit, a few tests written.Ryan Williams2010-02-251-0/+53
| |
* | Fixed race conditions in timeout tests.Ryan Williams2010-02-251-9/+14
| |
* | fix test_connect_timeout and test_connect_ex_timeout so they ignore ↵Tavis Rudd2010-02-241-26/+27
| | | | | | | | errno.EHOSTUNREACH *and* errno.ENETUNREACH
* | Tweaked the send_timeout test a little, mostly just so I understand it. ↵Ryan Williams2010-02-241-10/+8
| | | | | | | | Clearing exc_info right after squelching exceptions in hubs.
* | fixes #38. send() and sendall() seem to be good now (i think).Eugene Oden2010-02-241-4/+3
| |
* | working on blocking send, which still isn't quite right reopens #38Eugene Oden2010-02-241-1/+3
| |
* | minor fix for GreenSocket.send(). added socket.timeout arguments. more tests.Eugene Oden2010-02-221-1/+180
| | | | | | | | | | | | | | | | | | | | GreenSocket.send() wasn't blocking properly or raising a socket.timeout if the send buffer is full. added a call to trampoline() added tests for several GreenSocket methods to check for proper socket.timeout behavior fixed a couple of other tests with changed behavior due to the send() fix.
* | fixes for greenpipeEugene Oden2010-02-211-1/+33
|/ | | | | - make readuntil() call self._recv() instead of self.fd.read() - make readline() terminate on '\n' as well as '\r\n'
* Imported Timeout class from gevent, deprecated exc_after, replaced ↵Ryan Williams2010-02-151-1/+1
| | | | TimeoutError with Timeout (should be seamless).
* Moved a test.Ryan Williams2010-01-251-0/+40
|