def test_getHost(self):
        """
        L{SSHChannel.getHost} returns the same object as the underlying
        transport's C{getHost} method returns.
        """
        host = IPv4Address('TCP', '127.0.0.1', 12345)
        connectSSHTransport(service=self.channel.conn, hostAddress=host)

        self.assertEqual(SSHTransportAddress(host), self.channel.getHost())
    def test_getPeer(self):
        """
        L{SSHChannel.getPeer} returns the same object as the underlying
        transport's C{getPeer} method returns.
        """
        peer = IPv4Address('TCP', '192.168.0.1', 54321)
        connectSSHTransport(service=self.channel.conn, peerAddress=peer)

        self.assertEqual(SSHTransportAddress(peer), self.channel.getPeer())
示例#3
0
 def buildDifferentAddress(self):
     """
     Like C{buildAddress}, but with a different fixed address.
     """
     return SSHTransportAddress(IPv4Address("TCP", "127.0.0.2", 22))
示例#4
0
 def buildAddress(self):
     """
     Create an arbitrary new C{SSHTransportAddress}.  A new instance is
     created for each call, but always for the same address.
     """
     return SSHTransportAddress(IPv4Address("TCP", "127.0.0.1", 22))