@mock.patch('paramiko.SSHClient', create=True)
    @mock.patch('paramiko.AutoAddPolicy', create=True)
    def test_create_and_close_SSHConnection(self, mock_policy, ssh_client):
        SSHClientMock = namedtuple('SSHClient', 'connect set_missing_host_key_policy close')
        ssh_client_mock = SSHClientMock(
            connect=mock.Mock(),
            set_missing_host_key_policy=mock.Mock(),
            close=mock.Mock()
        )
        ssh_client.return_value = ssh_client_mock
        mock_policy.return_value = mock.Mock()

        # execute
        self.cdhUtilities.create_ssh_connection(self.cdhUtilities._hostname, self.cdhUtilities._username,
                                                                  self.cdhUtilities._key_filename, self.cdhUtilities._key_password)
        self.cdhUtilities.close_ssh_connection()

        # attest
        assert ssh_client_mock.set_missing_host_key_policy.call_count == 1
        assert ssh_client_mock.connect.call_count == 1
        assert ssh_client_mock.close.call_count == 1
        assert mock_policy.call_count == 1
        ssh_client_mock.connect.assert_called_with(self.cdhUtilities._hostname, key_filename=self.cdhUtilities._key_filename,
                                                   password=self.cdhUtilities._key_password, username=self.cdhUtilities._username)
Enforce that the WSGI response is a response object of the current
dataset/ETHPy150Open trustedanalytics/platform-appstack/tests/test_cdh_utilities.py/TestSSHConnectionToCdh.test_create_and_close_SSHConnection--crossover with--dataset/ETHPy150Open Eforcers/gae-flask-todo/lib/werkzeug/wrappers.py/BaseResponse.force_type