def test_emits_signal_once_wormhole_is_closed(self):
        ftp = FileTransferProtocol(self.reactor, self.signals)

        ftp.open(None)
        ftp.close()
        ftp._wormhole_delegate.wormhole_closed(result="ok")

        self.signals.wormhole_closed.emit.assert_called()
    def test_can_close_the_wormhole_and_transit(self):
        ftp = FileTransferProtocol(self.reactor, self.signals)

        ftp.open(None)
        ftp.close()

        self.wormhole.close.assert_called()
        self.transit.close.assert_called()
    def test_still_emits_signal_if_wormhole_was_not_open(self):
        ftp = FileTransferProtocol(self.reactor, self.signals)

        ftp.close()

        self.signals.wormhole_closed.emit.assert_called()