twisted.internet.test.test_tcp.AbortConnectionMixin(object)
class documentationtwisted.internet.test.test_tcp
(View In Hierarchy)
Known subclasses: twisted.internet.test.test_tcp.AbortConnectionTests, twisted.internet.test.test_tls.AbortSSLConnectionTests
Unit tests for ITransport.abortConnection
.
Method | runAbortTest | A test runner utility function, which hooks up a matched pair of client and server protocols. |
Method | test_dataReceivedAbort | abortConnection() is called in dataReceived. The protocol should be disconnected, but connectionLost should not be called re-entrantly. |
Method | test_clientAbortsConnectionTwice | abortConnection() is called twice by client. |
Method | test_clientAbortsConnectionThenLosesConnection | Client calls abortConnection(), followed by loseConnection(). |
Method | test_serverAbortsConnectionTwice | abortConnection() is called twice by server. |
Method | test_serverAbortsConnectionThenLosesConnection | Server calls abortConnection(), followed by loseConnection(). |
Method | test_resumeProducingAbort | abortConnection() is called in resumeProducing, before any bytes have been exchanged. The protocol should be disconnected, but connectionLost should not be called re-entrantly. |
Method | test_resumeProducingAbortLater | abortConnection() is called in resumeProducing, after some bytes have been exchanged. The protocol should be disconnected. |
Method | test_fullWriteBuffer | abortConnection() triggered by the write buffer being full. |
Method | test_fullWriteBufferAfterByteExchange | abortConnection() is triggered by a write buffer being full. |
Method | test_dataReceivedThrows | dataReceived calls abortConnection(), and then raises an exception. |
Method | test_resumeProducingThrows | resumeProducing calls abortConnection(), and then raises an exception. |
A test runner utility function, which hooks up a matched pair of client and server protocols.
We then run the reactor until both sides have disconnected, and then verify that the right exception resulted.
abortConnection() is called in dataReceived. The protocol should be disconnected, but connectionLost should not be called re-entrantly.
abortConnection() is called twice by client.
No exception should be thrown, and the connection will be closed.
Client calls abortConnection(), followed by loseConnection().
No exception should be thrown, and the connection will be closed.
abortConnection() is called twice by server.
No exception should be thrown, and the connection will be closed.
Server calls abortConnection(), followed by loseConnection().
No exception should be thrown, and the connection will be closed.
abortConnection() is called in resumeProducing, before any bytes have been exchanged. The protocol should be disconnected, but connectionLost should not be called re-entrantly.
abortConnection() is called in resumeProducing, after some bytes have been exchanged. The protocol should be disconnected.
abortConnection() triggered by the write buffer being full.
In particular, the server side stops reading. This is supposed to simulate a realistic timeout scenario where the client notices the server is no longer accepting data.
The protocol should be disconnected, but connectionLost should not be called re-entrantly.
abortConnection() is triggered by a write buffer being full.
However, this buffer is filled after some bytes have been exchanged, allowing a TLS handshake if we're testing TLS. The connection will then be lost.
dataReceived calls abortConnection(), and then raises an exception.
The connection will be lost, with the thrown exception
(ZeroDivisionError
) as the reason on the client. The idea here
is that bugs should not be masked by abortConnection, in particular
unexpected exceptions.
resumeProducing calls abortConnection(), and then raises an exception.
The connection will be lost, with the thrown exception
(ZeroDivisionError
) as the reason on the client. The idea here
is that bugs should not be masked by abortConnection, in particular
unexpected exceptions.