class documentation

Common methods for testing HostnameEndpoint against MemoryReactor instances that do not provide IReactorPluggableNameResolver.

Method assertConnectArgs Compare host, port, timeout, and bindAddress in receivedArgs to expectedArgs. We ignore the factory because we don't only care what protocol comes out of the IStreamClientEndpoint.connect call.
Method connectArgs No summary
Method expectedClients Extract expected clients from the reactor.
Method synchronousDeferredToThread A synchronous version of deferToThread.
Method test_deprecation Instantiating HostnameEndpoint with a reactor that does not provide IReactorPluggableResolver emits a deprecation warning.
Method test_endpointConnectFailure When HostnameEndpoint.connect cannot connect to its destination, the returned Deferred will fail with ConnectError.
Method test_errorsLogged Hostname resolution errors are logged.

Inherited from ClientEndpointTestCaseMixin:

Method retrieveConnectedFactory Retrieve a single factory that has connected using the given reactor. (This behavior is valid for TCP and SSL but needs to be overridden for UNIX.)
Method test_endpointConnectingCancelled Calling Deferred.cancel on the Deferred returned from IStreamClientEndpoint.connect is errbacked with an expected ConnectingCancelledError exception.
Method test_endpointConnectNonDefaultArgs The endpoint should pass it's connectArgs parameter to the reactor's listen methods.
Method test_endpointConnectSuccess A client endpoint can connect and returns a deferred who gets called back with a protocol instance.
Method test_interface The endpoint provides interfaces.IStreamClientEndpoint
def assertConnectArgs(self, receivedArgs, expectedArgs): (source)

Compare host, port, timeout, and bindAddress in receivedArgs to expectedArgs. We ignore the factory because we don't only care what protocol comes out of the IStreamClientEndpoint.connect call.

Parameters
receivedArgstuple of (host, port, factory, timeout, bindAddress) that was passed to IReactorTCP.connectTCP.
expectedArgstuple of (host, port, factory, timeout, bindAddress) that we expect to have been passed to IReactorTCP.connectTCP.
def connectArgs(self): (source)
Returns
dict of keyword arguments to pass to connect.
def expectedClients(self, reactor): (source)

Extract expected clients from the reactor.

Parameters
reactorThe MemoryReactor under test.
Returns
List of calls to IReactorTCP.connectTCP
def synchronousDeferredToThread(self, f, *args, **kwargs): (source)

A synchronous version of deferToThread.

Parameters
f:callableThe callable to invoke.
*argsPositional arguments to the callable.
**kwargsKeyword arguments to the callable.
Returns
A Deferred that fires with the result of applying f to args and kwargs or the exception raised.
def test_deprecation(self): (source)

Instantiating HostnameEndpoint with a reactor that does not provide IReactorPluggableResolver emits a deprecation warning.

def test_endpointConnectFailure(self): (source)

When HostnameEndpoint.connect cannot connect to its destination, the returned Deferred will fail with ConnectError.

def test_errorsLogged(self): (source)

Hostname resolution errors are logged.