def assertExecuteWithKexAlgorithm(self, keyExchangeAlgo):
        """
        Call execute() method of L{OpenSSHClientMixin} with an ssh option that
        forces the exclusive use of the key exchange algorithm specified by
        keyExchangeAlgo

        @type keyExchangeAlgo: L{str}
        @param keyExchangeAlgo: The key exchange algorithm to use

        @return: L{defer.Deferred}
        """
        kexAlgorithms = []
        try:
            output = subprocess.check_output([which('ssh')[0], '-Q', 'kex'],
                                             stderr=subprocess.STDOUT)
            if not isinstance(output, str):
                output = output.decode("utf-8")
            kexAlgorithms = output.split()
        except:
            pass

        if keyExchangeAlgo not in kexAlgorithms:
            raise unittest.SkipTest(
                "{} not supported by ssh client".format(
                    keyExchangeAlgo))

        d = self.execute('echo hello', ConchTestOpenSSHProcess(),
                         '-oKexAlgorithms=' + keyExchangeAlgo)
        return d.addCallback(self.assertEqual, b'hello\n')

        Call execute() method of L{OpenSSHClientMixin} with an ssh option that
        forces the exclusive use of the key exchange algorithm specified by
        keyExchangeAlgo

        @type keyExchangeAlgo: L{str}
        @param keyExchangeAlgo: The key exchange algorithm to use

        @return: L{defer.Deferred}
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/conch/test/test_conch.py