module documentation

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

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

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

def connectionCreatorFromEndpoint(memoryReactor, tlsEndpoint): (source)

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.

Parameters
memoryReactorthe 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.
Returns
IOpenSSLClientConnectionCreatorthe client connection creator associated with the endpoint wrapper.
def deterministicResolvingReactor(reactor, expectedAddresses=(), hostMap=None): (source)

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

Parameters
reactor:Any object with some formally-declared interfaces (i.e. one where list(providedBy(reactor)) is not empty); usually IReactor* interfaces.An object that we wish to add an IReactorPluggableNameResolver to.
expectedAddresses:iterable of object or str(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.
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.
Returns
A 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 replacingGlobals(function, **newGlobals): (source)

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

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

Parameters
function:types.FunctionTypeany function object.
**newGlobals:dicteach keyword argument should be a global to set in the new function's returned scope.
Returns
a new function, like function, but with new global scope.

Undocumented

chainPath = (source)

Undocumented

escapedCAsPathName = (source)

Undocumented

escapedChainPathName = (source)

Undocumented

escapedNoTrailingNewlineCertPEMPathName = (source)

Undocumented

escapedNoTrailingNewlineKeyPEMPathName = (source)

Undocumented

escapedPEMPathName = (source)

Undocumented

noTrailingNewlineCertPemPath = (source)

Undocumented

noTrailingNewlineKeyPemPath = (source)

Undocumented

Undocumented

Undocumented

skipSSLReason: str = (source)

Undocumented

testCertificate = (source)

Undocumented

testPrivateCertificate = (source)

Undocumented