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())
Beispiel #3
0
 def buildDifferentAddress(self):
     """
     Like C{buildAddress}, but with a different fixed address.
     """
     return SSHTransportAddress(IPv4Address("TCP", "127.0.0.2", 22))
Beispiel #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))