diff options
| -rw-r--r-- | tests/backdoor_test.py | 6 | ||||
| -rw-r--r-- | tests/debug_test.py | 4 | ||||
| -rw-r--r-- | tests/tpool_test.py | 7 |
3 files changed, 8 insertions, 9 deletions
diff --git a/tests/backdoor_test.py b/tests/backdoor_test.py index 345cbad..27bccc6 100644 --- a/tests/backdoor_test.py +++ b/tests/backdoor_test.py @@ -12,13 +12,13 @@ class BackdoorTest(LimitedTestCase): serv = eventlet.spawn(backdoor.backdoor_server, listener) client = socket.socket() client.connect(('localhost', listener.getsockname()[1])) - f = client.makefile() + f = client.makefile('rw') self.assert_('Python' in f.readline()) f.readline() # build info f.readline() # help info self.assert_('InteractiveConsole' in f.readline()) self.assertEquals('>>> ', f.read(4)) - f.write('print "hi"\n') + f.write('print("hi")\n') f.flush() self.assertEquals('hi\n', f.readline()) self.assertEquals('>>> ', f.read(4)) @@ -31,4 +31,4 @@ class BackdoorTest(LimitedTestCase): if __name__ == '__main__': - main()
\ No newline at end of file + main() diff --git a/tests/debug_test.py b/tests/debug_test.py index 61b4ba4..4edcb0f 100644 --- a/tests/debug_test.py +++ b/tests/debug_test.py @@ -2,7 +2,7 @@ import sys import eventlet from eventlet import debug -from tests import LimitedTestCase, main +from tests import LimitedTestCase, main, s2b from unittest import TestCase try: @@ -117,7 +117,7 @@ class TestDebug(LimitedTestCase): try: gt = eventlet.spawn(hurl, client_2) eventlet.sleep(0) - client.send(' ') + client.send(s2b(' ')) eventlet.sleep(0) # allow the "hurl" greenlet to trigger the KeyError # not sure why the extra context switch is needed diff --git a/tests/tpool_test.py b/tests/tpool_test.py index 001849c..bd61e79 100644 --- a/tests/tpool_test.py +++ b/tests/tpool_test.py @@ -57,8 +57,7 @@ class TestTpool(LimitedTestCase): @skip_with_pyevent def test_wrap_uniterable(self): - # here we're treating the exception as just a normal class - prox = tpool.Proxy(FloatingPointError()) + prox = tpool.Proxy([]) def index(): prox[0] def key(): @@ -81,8 +80,8 @@ class TestTpool(LimitedTestCase): def test_wrap_module_class(self): prox = tpool.Proxy(re) self.assertEqual(tpool.Proxy, type(prox)) - exp = prox.compile('.') - self.assertEqual(exp.flags, 0) + exp = prox.compile('(.)(.)(.)') + self.assertEqual(exp.groups, 3) self.assert_(repr(prox.compile)) @skip_with_pyevent |
