Known subclasses: twisted.internet.test.test_tcp.TCPFDPortTestsBuilder, twisted.internet.test.test_tcp.TCPPortTestsBuilder

Tests for IReactorTCP.listenTCP

Method getExpectedStartListeningLogMessage Get the message expected to be logged when a TCP port starts listening.
Method getExpectedConnectionLostLogMsg Get the expected connection lost message for a TCP port.
Method test_portGetHostOnIPv4 When no interface is passed to IReactorTCP.listenTCP, the returned listening port listens on an IPv4 address.
Method test_portGetHostOnIPv6 When listening on an IPv6 address, IListeningPort.getHost returns an IPv6Address with host and port attributes reflecting the address the port is bound to.
Method test_portGetHostOnIPv6ScopeID No summary
Method test_buildProtocolIPv4Address When a connection is accepted over IPv4, an IPv4Address is passed to the factory's buildProtocol method giving the peer's address.
Method test_buildProtocolIPv6Address When a connection is accepted to an IPv6 address, an IPv6Address is passed to the factory's buildProtocol method giving the peer's address.
Method test_buildProtocolIPv6AddressScopeID When a connection is accepted to a link-local IPv6 address, an IPv6Address is passed to the factory's buildProtocol method giving the peer's address, including a scope identifier.
Method test_serverGetHostOnIPv4 When a connection is accepted over IPv4, the server ITransport.getHost method returns an IPv4Address giving the address on which the server accepted the connection.
Method test_serverGetHostOnIPv6 When a connection is accepted over IPv6, the server ITransport.getHost method returns an IPv6Address giving the address on which the server accepted the connection.
Method test_serverGetHostOnIPv6ScopeID No summary
Method test_serverGetPeerOnIPv4 When a connection is accepted over IPv4, the server ITransport.getPeer method returns an IPv4Address giving the address of the remote end of the connection.
Method test_serverGetPeerOnIPv6 When a connection is accepted over IPv6, the server ITransport.getPeer method returns an IPv6Address giving the address on the remote end of the connection.
Method test_serverGetPeerOnIPv6ScopeID No summary
Method _buildProtocolAddressTest Connect client to a server listening on interface started with IReactorTCP.listenTCP and return the address passed to the factory's buildProtocol method.
Method _serverGetConnectionAddressTest Connect client to a server listening on interface started with IReactorTCP.listenTCP and return the address returned by one of the server transport's address lookup methods, getHost or getPeer.
def getExpectedStartListeningLogMessage(self, port, factory):

Get the message expected to be logged when a TCP port starts listening.

def getExpectedConnectionLostLogMsg(self, port):

Get the expected connection lost message for a TCP port.

def test_portGetHostOnIPv4(self):

When no interface is passed to IReactorTCP.listenTCP, the returned listening port listens on an IPv4 address.

def test_portGetHostOnIPv6(self):

When listening on an IPv6 address, IListeningPort.getHost returns an IPv6Address with host and port attributes reflecting the address the port is bound to.

def test_portGetHostOnIPv6ScopeID(self):

When a link-local IPv6 address including a scope identifier is passed as the interface argument to IReactorTCP.listenTCP, the resulting IListeningPort reports its address as an IPv6Address with a host value that includes the scope identifier.

def _buildProtocolAddressTest(self, client, interface):

Connect client to a server listening on interface started with IReactorTCP.listenTCP and return the address passed to the factory's buildProtocol method.

ParametersclientA SOCK_STREAM socket.socket created with an address family such that it will be able to connect to a server listening on interface.
interfaceA str giving an address for a server to listen on. This should almost certainly be the loopback address for some address family supported by IReactorTCP.listenTCP.
ReturnsWhatever object, probably an IAddress provider, is passed to a server factory's buildProtocol method when client establishes a connection.
def test_buildProtocolIPv4Address(self):

When a connection is accepted over IPv4, an IPv4Address is passed to the factory's buildProtocol method giving the peer's address.

def test_buildProtocolIPv6Address(self):

When a connection is accepted to an IPv6 address, an IPv6Address is passed to the factory's buildProtocol method giving the peer's address.

def test_buildProtocolIPv6AddressScopeID(self):

When a connection is accepted to a link-local IPv6 address, an IPv6Address is passed to the factory's buildProtocol method giving the peer's address, including a scope identifier.

def _serverGetConnectionAddressTest(self, client, interface, which):

Connect client to a server listening on interface started with IReactorTCP.listenTCP and return the address returned by one of the server transport's address lookup methods, getHost or getPeer.

ParametersclientA SOCK_STREAM socket.socket created with an address family such that it will be able to connect to a server listening on interface.
interfaceA str giving an address for a server to listen on. This should almost certainly be the loopback address for some address family supported by IReactorTCP.listenTCP.
whichA str equal to either "getHost" or "getPeer" determining which address will be returned.
ReturnsWhatever object, probably an IAddress provider, is returned from the method indicated by which.
def test_serverGetHostOnIPv4(self):

When a connection is accepted over IPv4, the server ITransport.getHost method returns an IPv4Address giving the address on which the server accepted the connection.

def test_serverGetHostOnIPv6(self):

When a connection is accepted over IPv6, the server ITransport.getHost method returns an IPv6Address giving the address on which the server accepted the connection.

def test_serverGetHostOnIPv6ScopeID(self):

When a connection is accepted over IPv6, the server ITransport.getHost method returns an IPv6Address giving the address on which the server accepted the connection, including the scope identifier.

def test_serverGetPeerOnIPv4(self):

When a connection is accepted over IPv4, the server ITransport.getPeer method returns an IPv4Address giving the address of the remote end of the connection.

def test_serverGetPeerOnIPv6(self):

When a connection is accepted over IPv6, the server ITransport.getPeer method returns an IPv6Address giving the address on the remote end of the connection.

def test_serverGetPeerOnIPv6ScopeID(self):

When a connection is accepted over IPv6, the server ITransport.getPeer method returns an IPv6Address giving the address on the remote end of the connection, including the scope identifier.

API Documentation for twisted, generated by pydoctor at 2020-03-25 17:34:30.