Commit 417c73a9 authored by Jason Madden's avatar Jason Madden

fix test__socketpair

parent 90ab5cd6
......@@ -5,6 +5,7 @@ import time
from gevent import _socketcommon
import _socket
from io import BlockingIOError
from os import dup
for key in _socketcommon.__dict__:
if key.startswith('__'):
......
......@@ -6,15 +6,15 @@ import unittest
class Test(unittest.TestCase):
def test(self):
msg = 'hello world'
msg = b'hello world'
x, y = socket.socketpair()
x.sendall(msg)
x.close()
read = y.makefile().read()
read = y.makefile('rb').read()
self.assertEqual(msg, read)
def test_fromfd(self):
msg = 'hello world'
msg = b'hello world'
x, y = socket.socketpair()
xx = socket.fromfd(x.fileno(), x.family, socket.SOCK_STREAM)
x.close()
......@@ -23,7 +23,7 @@ class Test(unittest.TestCase):
xx.sendall(msg)
xx.close()
read = yy.makefile().read()
read = yy.makefile('rb').read()
self.assertEqual(msg, read)
......
......@@ -94,7 +94,6 @@ test__pywsgi.py
test__socket_ex.py
test__example_echoserver.py
test__makefile_ref.py
test__socketpair.py
test__server_pywsgi.py
test__core_stat.py
test__example_portforwarder.py
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment