def test_getHost(self): """ L{IListeningPort.getHost} returns an L{IPv4Address} giving a dotted-quad of the IPv4 address the port is listening on as well as the port number. """ host, portNumber = findFreePort(type=socket.SOCK_DGRAM) reactor = self.buildReactor() port = self.getListeningPort(reactor, DatagramProtocol(), port=portNumber, interface=host) self.assertEqual(port.getHost(), IPv4Address("UDP", host, portNumber))
def test_getHost(self): """ L{IListeningPort.getHost} returns an L{IPv4Address} giving a dotted-quad of the IPv4 address the port is listening on as well as the port number. """ host, portNumber = findFreePort(type=socket.SOCK_DGRAM) reactor = self.buildReactor() port = self.getListeningPort( reactor, DatagramProtocol(), port=portNumber, interface=host) self.assertEqual( port.getHost(), IPv4Address('UDP', host, portNumber))