'Whenever an SSH channel gets closed any Deferred that was returned by a
sendRequest() on its parent connection must be errbacked.'

def test_channelClosedCausesLeftoverChannelDeferredsToErrback(self):

    channel = TestChannel()
    self._openChannel(channel)
    d = self.conn.sendRequest(channel, 'dummyrequest', 'dummydata', wantReply=1)
    d = self.assertFailure(d, error.ConchError)
    self.conn.channelClosed(channel)
    return d
