'If the SSH server rejects the password presented during authentication,
the L{Deferred} returned by L{SSHCommandClientEndpoint.connect} fires
with a L{Failure} wrapping L{AuthenticationFailed}.'

def test_passwordAuthenticationFailure(self):

    endpoint = SSHCommandClientEndpoint.newConnection(self.reactor, '/bin/ls    -l', 'dummy    user', self.hostname, self.port, password='dummy    password', knownHosts=self.knownHosts, ui=FixedResponseUI(False))
    factory = Factory()
    factory.protocol = Protocol
    connected = endpoint.connect(factory)
    (server, client, pump) = self.connectedServerAndClient(self.factory, self.reactor.tcpClients[0][2])
    self.reactor.advance(server.service.passwordDelay)
    pump.flush()
    f = self.failureResultOf(connected)
    f.trap(AuthenticationFailed)
    self.assertClientTransportState(client, False)
