Fix for api_test's connect_ssl test mucking up subsequent tests.
This commit is contained in:
@@ -86,8 +86,10 @@ class TestApi(TestCase):
|
|||||||
try:
|
try:
|
||||||
conn, addr = listenfd.accept()
|
conn, addr = listenfd.accept()
|
||||||
conn.write('hello\r\n')
|
conn.write('hello\r\n')
|
||||||
|
conn.shutdown()
|
||||||
conn.close()
|
conn.close()
|
||||||
finally:
|
finally:
|
||||||
|
listenfd.shutdown()
|
||||||
listenfd.close()
|
listenfd.close()
|
||||||
|
|
||||||
server = api.ssl_listener(('0.0.0.0', 0),
|
server = api.ssl_listener(('0.0.0.0', 0),
|
||||||
@@ -100,8 +102,11 @@ class TestApi(TestCase):
|
|||||||
fd = socket._fileobject(client, 'rb', 8192)
|
fd = socket._fileobject(client, 'rb', 8192)
|
||||||
|
|
||||||
assert fd.readline() == 'hello\r\n'
|
assert fd.readline() == 'hello\r\n'
|
||||||
assert fd.read() == ''
|
self.assertRaises(greenio.SSL.ZeroReturnError, fd.read)
|
||||||
|
client.shutdown()
|
||||||
client.close()
|
client.close()
|
||||||
|
|
||||||
|
check_hub()
|
||||||
|
|
||||||
def test_server(self):
|
def test_server(self):
|
||||||
connected = []
|
connected = []
|
||||||
|
Reference in New Issue
Block a user