@patch('ansible_collections.netapp.ontap.plugins.module_utils.netapp.OntapRestAPI.send_request')
def test_negative_connection_error(self, mock_request):
    data = dict(self.mock_args())
    data['verb'] = 'OPTIONS'
    set_module_args(data)
    mock_request.side_effect = [SRR['generic_error'], SRR['end_of_sequence']]
    with pytest.raises(AnsibleFailJson) as exc:
        self.get_cli_mock_object().apply()
    msg = "failed to connect to REST over test: ['Expected error'].  Use na_ontap_command for non-rest CLI."
    assert (msg in exc.value.args[0]['msg'])
@patch('ansible_collections.netapp.ontap.plugins.module_utils.netapp.OntapRestAPI.send_request')
def test_negative_connection_error(self, mock_request):
    data = dict(self.mock_args())
    data['verb'] = 'OPTIONS'
    set_module_args(data)
    mock_request.side_effect = [SRR['generic_error'], SRR['end_of_sequence']]
    with pytest.raises(AnsibleFailJson) as exc:
        self.get_cli_mock_object().apply()
    msg = "failed to connect to REST over test: ['Expected error'].  Use na_ontap_command for non-rest CLI."
    assert (msg in exc.value.args[0]['msg'])