twisted.internet.test.test_endpoints._HostnameEndpointMemoryReactorMixin(ClientEndpointTestCaseMixin) class documentationtwisted.internet.test.test_endpoints
(View In Hierarchy)
Known subclasses: twisted.internet.test.test_endpoints.HostnameEndpointMemoryIPv4ReactorTests, twisted.internet.test.test_endpoints.HostnameEndpointMemoryIPv6ReactorTests
Common methods for testing HostnameEndpoint
against MemoryReactor
instances that do not provide IReactorPluggableNameResolver.
| Method | synchronousDeferredToThread | A synchronous version of deferToThread. | 
| Method | expectedClients | Extract expected clients from the reactor. | 
| Method | connectArgs | |
| Method | assertConnectArgs | No summary | 
| Method | test_endpointConnectFailure | When HostnameEndpoint.connectcannot connect to its destination, the returnedDeferredwill 
fail withConnectError. | 
| Method | test_deprecation | Instantiating HostnameEndpointwith a reactor that does not provideIReactorPluggableResolveremits a deprecation warning. | 
| Method | test_errorsLogged | Hostname resolution errors are logged. | 
Inherited from ClientEndpointTestCaseMixin:
| Method | test_interface | The endpoint provides interfaces.IStreamClientEndpoint | 
| 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_endpointConnectSuccess | A client endpoint can connect and returns a deferred who gets called back with a protocol instance. | 
| Method | test_endpointConnectingCancelled | Calling Deferred.cancelon theDeferredreturned fromIStreamClientEndpoint.connectis errbacked with an expectedConnectingCancelledErrorexception. | 
| Method | test_endpointConnectNonDefaultArgs | The endpoint should pass it's connectArgs parameter to the reactor's listen methods. | 
A synchronous version of deferToThread.
| Parameters | f | The callable to invoke. (type: callable) | 
| args | Positional arguments to the callable. | |
| kwargs | Keyword arguments to the callable. | |
| Returns | A Deferredthat fires with the result of applyingftoargsandkwargsor the exception raised. | |
Extract expected clients from the reactor.
| Parameters | reactor | The MemoryReactorunder test. | 
| Returns | List of calls to IReactorTCP.connectTCP | |
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 | receivedArgs | tupleof (host,port,factory,timeout,bindAddress) that 
was passed toIReactorTCP.connectTCP. | 
| expectedArgs | tupleof (host,port,factory,timeout,bindAddress) that 
we expect to have been passed toIReactorTCP.connectTCP. | 
When HostnameEndpoint.connect
cannot connect to its destination, the returned Deferred will 
fail with ConnectError.
Instantiating HostnameEndpoint
with a reactor that does not provide IReactorPluggableResolver
emits a deprecation warning.