Tests for implementations of IReactorTCP
and the TCP parts of IReactorSocket
.
Class |
|
Unit tests for ITransport.abortConnection . |
Class |
|
TCP-specific AbortConnectionMixin tests. |
Class |
|
Call abortConnection() after writing some data. |
Class |
|
Call abortConnection() and then loseConnection(). |
Class |
|
Call abortConnection() twice, after writing some data. |
Class |
|
Protocol that writes data upon connection. |
Class |
|
Test server transports built using adoptStreamConnection. |
Class |
|
Tests for assertPeerClosedOnEMFILE . |
Class |
|
Base class for abort-testing clients. |
Class |
|
Tests for _BuffersLogs . |
Class |
|
Provides connectToListener for TCP transports. |
Class |
|
Call abortConnection(), and then throw exception, from dataReceived. |
Class |
|
Like NoReadServer, except we Wait until some bytes have been delivered before stopping reading. This means TLS handshake has finished, where applicable. |
Class |
|
Tests for _ExhaustsFileDescriptors . |
Class |
|
An IProtocol that returns a value from its dataReceived method. |
Class |
|
A resolver implementation based on a dict mapping names to addresses. |
Class |
|
A fake for socket.socket objects. |
Class |
|
Test that the FakeSocket can be used by the doRead method of Connection |
Class |
|
Tests for _FileDescriptorReservation . |
Class |
|
Mixin which uses IReactorTCP.listenTCP to hand out listening TCP ports. |
Class |
|
Stop reading immediately on connection. |
Class |
|
Tests for _NullFileDescriptorReservation . |
Class |
|
Call abortConnection from doWrite, via resumeProducing. |
Class |
|
Call abortConnection from doWrite, via resumeProducing. |
Class |
|
Server that should never receive any data, except 'X's which are written by the other side of the connection before abortConnection, and so might possibly arrive. |
Class |
|
Call abortConnection() and throw exception from resumeProducing(). |
Class |
|
Call abortConnection() followed by loseConnection(). |
Class |
|
Call abortConnection() twice. |
Class |
|
Simple, direct tests for helpers within twisted.internet.tcp . |
Class |
|
Mixin which uses IReactorSocket.adoptStreamPort to hand out listening TCP ports. |
Class |
|
Protocol that pauses and resumes the transport a few times |
Class |
|
Call abortConnection() when the other side has stopped reading. |
Class |
|
Call abortConnection() from dataReceived, after bytes have been exchanged. |
Class |
|
Mixin defining tests which apply to any port/connection based transport. |
Class |
|
Builder configured with IPv4 parameters for tests related to IReactorTCP.connectTCP . |
Class |
|
Undocumented |
Class |
|
Builder configured with IPv6 parameters for tests related to IReactorTCP.connectTCP . |
Class |
|
Undocumented |
Class |
|
Create IPv6 TCP endpoints for ReactorBuilder.runProtocolsWithReactor-based tests. |
Class |
|
Base class for builders defining tests related to IReactorTCP.connectTCP . Classes which uses this in must provide all of the documented instance variables in order to specify how the test works. These are documented as instance variables rather than declared as methods due to some peculiar inheritance ordering concerns, but they are effectively abstract methods. |
Class |
|
Whitebox tests for twisted.internet.tcp.Connection . |
Class |
|
Builder defining tests relating to twisted.internet.tcp.Connection . |
Class |
|
Tests for the IConnector provider returned by IReactorTCP.connectTCP . |
Class |
|
Create IPv4 TCP endpoints for runProtocolsWithReactor -based tests. |
Class |
|
Undocumented |
Class |
|
Undocumented |
Class |
|
Tests for IReactorTCP.listenTCP |
Class |
|
Whitebox tests for twisted.internet.tcp.Server . |
Class |
|
Test mixing for TCP server address building and log prefix. |
Class |
|
Test standard ITCPTransport s built with listenTCP and connectTCP. |
Class |
|
Test for twisted.internet.abstract.FileDescriptor.writeSequence . |
Class |
|
Write data, but don't abort. |
Function | assert |
Use the given test to assert that the given transport is not actively reading in the given reactor. |
Function | assert |
Assert that an IListeningPort immediately closes an accepted peer socket when the number of open file descriptors exceeds the soft resource limit. |
Function | assert |
Use the given test to assert that the given transport is actively reading in the given reactor. |
Function | connect |
Connect a socket to the given destination. |
Function | create |
Create a socket for the duration of the given test. |
Function | get |
Find and return a configured link local IPv6 address including a scope identifier using the % separation syntax. If the system has no link local IPv6 addresses, raise SkipTest instead. |
Function | one |
Decorate a ReactorBuilder test function which tests one reactor and one connected transport. Run that test method in the context of connectionMade, and immediately drop the connection (and end the test) when that completes. |
Constant | SKIP |
Undocumented |
Variable | s |
Undocumented |
Interface | _ |
A way to trigger EMFILE. |
Class | _ |
A class that triggers EMFILE by creating as many file descriptors as necessary. |
Class | _ |
An in-memory implementation of IReactorFDSet , which records the current sets of active IReadDescriptor and IWriteDescriptor s. |
Use the given test to assert that the given transport is not actively reading in the given reactor.
Parameters | |
testTestCase | a test case to perform the assertion upon. |
reactor | A reactor, possibly one providing IReactorFDSet , or an IOCP reactor. |
transport | An ITCPTransport |
Note | |
Maintainers; for more information on why this is a function rather than a method on a test case, see this document on how we structure test tools |
Assert that an IListeningPort
immediately closes an accepted peer socket when the number of open file descriptors exceeds the soft resource limit.
Parameters | |
testtrial.unittest.SynchronousTestCase | The test case under which to run this assertion. |
exhauster:_ExhaustsFileDescriptors | The file descriptor exhauster. |
reactor | The reactor under test. |
run | A callable that will synchronously run the provided reactor. |
listen:A callable that accepts two arguments: the provided reactor; and a ServerFactory . It must return an IListeningPort provider. | A callback to bind to a port. |
connect:A callable that accepts three arguments: the provided reactor; the address returned by IListeningPort.getHost ; and a ClientFactory . Its return value is ignored. | A callback to connect a client to the listening port. |
Use the given test to assert that the given transport is actively reading in the given reactor.
Parameters | |
testTestCase | a test case to perform the assertion upon. |
reactor | A reactor, possibly one providing IReactorFDSet , or an IOCP reactor. |
transport | An ITCPTransport |
Note | |
Maintainers; for more information on why this is a function rather than a method on a test case, see this document on how we structure test tools |
Connect a socket to the given destination.
Parameters | |
client | A socket.socket. |
destination | A tuple of (host, port). The host is a str, the port a int. If the host is an IPv6 IP, the address is resolved using getaddrinfo and the first version found is used. |
Create a socket for the duration of the given test.
Parameters | |
test | the test to add cleanup to. |
address | an AF_* constant |
socket | a SOCK_* constant. |
Returns | |
a socket object. |
Find and return a configured link local IPv6 address including a scope identifier using the % separation syntax. If the system has no link local IPv6 addresses, raise SkipTest
instead.
Returns | |
a str giving the address | |
Raises | |
SkipTest | if no link local address can be found or if the netifaces module is not available. |
Decorate a ReactorBuilder
test function which tests one reactor and one connected transport. Run that test method in the context of connectionMade, and immediately drop the connection (and end the test) when that completes.
Parameters | |
test | A unit test method on a ReactorBuilder test suite; taking two additional parameters; a reactor as built by the ReactorBuilder , and an ITCPTransport provider. |
Returns | |
1-argument function | a no-argument test method. |