'If execution of the command fails, the L{Deferred} returned by
L{SSHCommandClientEndpoint.connect} fires with a L{Failure} wrapping
the reason given by the server.'

def test_execFailure(self):

    self.realm.channelLookup['session'] = BrokenExecSession
    endpoint = self.create()
    factory = Factory()
    factory.protocol = Protocol
    connected = endpoint.connect(factory)
    (server, client, pump) = self.finishConnection()
    f = self.failureResultOf(connected)
    f.trap(ConchError)
    self.assertEqual('channel    request    failed', f.value.value)
    self.assertClientTransportState(client, False)
