Commit a7d1fc4f authored by Denis Bilenko's avatar Denis Bilenko

test__socket: remove test_recv_timeout and test_sendall_timeout because...

test__socket: remove test_recv_timeout and test_sendall_timeout because inherited versions are good enough
parent 583278fe
......@@ -133,34 +133,6 @@ class TestSSL(TestTCP):
def create_connection(self):
return socket.create_connection_ssl(('127.0.0.1', self.listener.getsockname()[1]))
def test_recv_timeout(self):
incoming = []
acceptor = gevent.spawn_link_exception(lambda : incoming.append(self.listener.accept()))
client = self.create_connection()
client.settimeout(0.1)
start = time.time()
try:
data = client.recv(1024)
except socket.timeout:
assert time.time() - start >= 0.1 - 0.01, (time.time() - start)
else:
raise AssertionError('socket.timeout should have been raised, instead recv returned %r' % (data, ))
acceptor.get()
def test_sendall_timeout(self):
incoming = []
acceptor = gevent.spawn_link_exception(lambda : incoming.append(self.listener.accept()))
client = self.create_connection()
client.settimeout(0.1)
start = time.time()
try:
result = client.sendall('h'*1000000)
except socket.timeout:
assert time.time() - start >= 0.1 - 0.01, (time.time() - start)
else:
raise AssertionError('socket.timeout should have been raised, instead sendall returned %r' % (result, ))
acceptor.get()
if __name__=='__main__':
greentest.main()
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