py3k - more testcases ported

This commit is contained in:
amajorek
2010-03-07 04:28:25 -05:00
parent fcd285741b
commit fcafbbf322
3 changed files with 8 additions and 9 deletions

View File

@@ -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()
main()

View File

@@ -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

View File

@@ -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