def get_interface_mock_object(self, kind=None):
     """
     Helper method to return an na_ontap_interface object
     :param kind: passes this param to MockONTAPConnection()
     :return: na_ontap_interface object
     """
     interface_obj = interface_module()
     interface_obj.autosupport_log = Mock(return_value=None)
     if kind is None:
         interface_obj.server = MockONTAPConnection()
     else:
         interface_obj.server = MockONTAPConnection(kind=kind, data=self.mock_interface)
     return interface_obj
Ejemplo n.º 2
0
 def test_module_fail_when_required_args_missing(self):
     ''' required arguments are reported as errors '''
     with pytest.raises(AnsibleFailJson) as exc:
         set_module_args({})
         interface_module()
     print('Info: %s' % exc.value.args[0]['msg'])