Test the I...Endpoint implementations that wrap the IReactorTCP, IReactorSSL, and IReactorUNIX interfaces found in twisted.internet.endpoints.

Class TestProtocol Protocol whose only function is to callback deferreds on the factory when it is connected or disconnected.
Class TestHalfCloseableProtocol A Protocol that implements IHalfCloseableProtocol and records whether its readConnectionLost and {writeConnectionLost} methods are called.
Class TestFileDescriptorReceiverProtocol A Protocol that implements IFileDescriptorReceiver and records how its fileDescriptorReceived method is called.
Class TestHandshakeListener A Protocol that implements IHandshakeListener and records the number of times its handshakeCompleted method has been called.
Class TestFactory Simple factory to be used both when connecting and listening. It contains two deferreds which are called back when my protocol connects and disconnects.
Class NoneFactory A one off factory whose buildProtocol returns None.
Class WrappingFactoryTests Test the behaviour of our ugly implementation detail _WrappingFactory.
Class ClientEndpointTestCaseMixin Generic test methods to be mixed into all client endpoint test classes.
Class ServerEndpointTestCaseMixin Generic test methods to be mixed into all client endpoint test classes.
Class EndpointTestCaseMixin Generic test methods to be mixed into all endpoint test classes.
Class SpecificFactory An IProtocolFactory whose buildProtocol always returns its specificProtocol and sets passedAddress.
Class FakeStdio A stdio.StandardIO like object that simply captures its constructor arguments.
Class StandardIOEndpointsTests Tests for Standard I/O Endpoints
Class StubApplicationProtocol An IProtocol provider.
Class MemoryProcessTransport A fake IProcessTransport provider to be used in tests.
Class MemoryProcessReactor A fake IReactorProcess provider to be used in tests.
Class ProcessEndpointsTests Tests for child process endpoints.
Class ProcessEndpointTransportTests Test the behaviour of the implementation detail endpoints._ProcessEndpointTransport.
Class WrappedIProtocolTests Test the behaviour of the implementation detail _WrapIProtocol.
Class TCP4EndpointsTests Tests for TCP IPv4 Endpoints.
Class TCP6EndpointsTests Tests for TCP IPv6 Endpoints.
Class TCP6EndpointNameResolutionTests Tests for a TCP IPv6 Client Endpoint pointed at a hostname instead of an IPv6 address literal.
Class RaisingMemoryReactorWithClock An extension of RaisingMemoryReactor with task.Clock.
Function deterministicResolvingReactor Create a reactor that will deterministically resolve all hostnames it is passed to the list of addresses given.
Class SimpleHostnameResolverTests Tests for endpoints._SimpleHostnameResolver.
Class HostnameEndpointFallbackNameResolutionTests HostnameEndpoint._fallbackNameResolution defers a name resolution call to a thread.
Class HostnameEndpointMemoryIPv4ReactorTests IPv4 resolution tests for HostnameEndpoint with MemoryReactor subclasses that do not provide IReactorPluggableNameResolver.
Class HostnameEndpointMemoryIPv6ReactorTests IPv6 resolution tests for HostnameEndpoint with MemoryReactor subclasses that do not provide IReactorPluggableNameResolver.
Class HostnameEndpointsOneIPv4Tests Tests for the hostname based endpoints when GAI returns only one (IPv4) address.
Class HostnameEndpointsOneIPv6Tests Tests for the hostname based endpoints when GAI returns only one (IPv6) address.
Class HostnameEndpointIDNATests Tests for HostnameEndpoint's constructor's encoding behavior.
Class HostnameEndpointReprTests Tests for HostnameEndpoint's string representation.
Class HostnameEndpointsGAIFailureTests Tests for the hostname based endpoints when GAI returns no address.
Class HostnameEndpointsFasterConnectionTests Tests for the hostname based endpoints when gai returns an IPv4 and an IPv6 address, and one connection takes less time than the other.
Class SSL4EndpointsTests Tests for SSL Endpoints.
Class UNIXEndpointsTests Tests for UnixSocket Endpoints.
Class ParserTests Tests for endpoints._parseServer, the low-level parsing logic.
Class ServerStringTests Tests for twisted.internet.endpoints.serverFromString.
Function addFakePlugin For the duration of testCase, add a fake plugin to twisted.plugins which contains some sample endpoint parsers.
Class ClientStringTests Tests for twisted.internet.endpoints.clientFromString.
Class SSLClientStringTests Tests for twisted.internet.endpoints.clientFromString which require SSL.
Class AdoptedStreamServerEndpointTests Tests for adopted socket-based stream server endpoints.
Class SystemdEndpointPluginTests Unit tests for the systemd stream server endpoint and endpoint string description parser.
Class TCP6ServerEndpointPluginTests Unit tests for the TCP IPv6 stream server endpoint string description parser.
Class StandardIOEndpointPluginTests Unit tests for the Standard I/O endpoint string description parser.
Class ConnectProtocolTests Tests for connectProtocol.
Class UppercaseWrapperProtocol A wrapper protocol which uppercases all strings passed through it.
Class UppercaseWrapperFactory A wrapper factory which uppercases all strings passed through it.
Class NetstringTracker A netstring receiver which keeps track of the strings received.
Class FakeError An error which isn't really an error.
Class WrapperClientEndpointTests Tests for _WrapperClientEndpoint.
Function connectionCreatorFromEndpoint Given a MemoryReactor and the result of calling wrapClientTLS, extract the IOpenSSLClientConnectionCreator associated with it.
Class WrapClientTLSParserTests Tests for _TLSClientEndpointParser.
Function replacingGlobals Create a copy of the given function with the given globals substituted.
Class WrapClientTLSTests Tests for the error-reporting behavior of wrapClientTLS when pyOpenSSL is unavailable.
Class _HostnameEndpointMemoryReactorMixin Common methods for testing HostnameEndpoint against MemoryReactor instances that do not provide IReactorPluggableNameResolver.
def deterministicResolvingReactor(reactor, expectedAddresses=(), hostMap=None):

Create a reactor that will deterministically resolve all hostnames it is passed to the list of addresses given.

ParametersreactorAn object that we wish to add an IReactorPluggableNameResolver to. (type: Any object with some formally-declared interfaces (i.e. one where list(providedBy(reactor)) is not empty); usually IReactor* interfaces.)
expectedAddresses(optional); the addresses expected to be returned for every address. If these are strings, they should be IPv4 or IPv6 literals, and they will be wrapped in IPv4Address and IPv6Address objects in the resolution result. (type: iterable of object or str)
hostMap(optional); the names (unicode) mapped to lists of addresses (str or IAddress); in the same format as expectedAddress, which map the results for specific hostnames to addresses.
ReturnsA new reactor which provides all the interfaces previously provided by reactor as well as IReactorPluggableNameResolver. All name resolutions performed with its nameResolver attribute will resolve reentrantly and synchronously with the given expectedAddresses. However, it is not a complete implementation as it does not have an installNameResolver method.
def addFakePlugin(testCase, dropinSource='fakeendpoint.py'):

For the duration of testCase, add a fake plugin to twisted.plugins which contains some sample endpoint parsers.

def connectionCreatorFromEndpoint(memoryReactor, tlsEndpoint):

Given a MemoryReactor and the result of calling wrapClientTLS, extract the IOpenSSLClientConnectionCreator associated with it.

Implementation presently uses private attributes but could (and should) be refactored to just call .connect() on the endpoint, when HostnameEndpoint starts directing its getaddrinfo call through the reactor it is passed somehow rather than via the global threadpool.

ParametersmemoryReactorthe reactor attached to the given endpoint. (Presently unused, but included so tests won't need to be modified to honor it.)
tlsEndpointThe result of calling wrapClientTLS.
Returnsthe client connection creator associated with the endpoint wrapper. (type: IOpenSSLClientConnectionCreator)
def replacingGlobals(function, **newGlobals):

Create a copy of the given function with the given globals substituted.

The globals must already exist in the function's existing global scope.

Parametersfunctionany function object. (type: types.FunctionType)
newGlobalseach keyword argument should be a global to set in the new function's returned scope. (type: dict)
Returnsa new function, like function, but with new global scope.
API Documentation for twisted, generated by pydoctor at 2020-03-25 17:34:30.