def get_job_mock_object(self, kind=None): """ Helper method to return an na_ontap_job_schedule object :param kind: passes this param to MockONTAPConnection() :return: na_ontap_job_schedule object """ job_obj = job_module() job_obj.autosupport_log = Mock(return_value=None) if kind is None: job_obj.server = MockONTAPConnection() else: job_obj.server = MockONTAPConnection(kind=kind, data=self.mock_job) return job_obj
def test_module_fail_when_required_args_missing(self): ''' required arguments are reported as errors ''' with pytest.raises(AnsibleFailJson) as exc: set_module_args({}) job_module() print('Info: %s' % exc.value.args[0]['msg'])