def test_enable_job(self): ''' Test if it enable a job in the minion's schedule. ''' with patch.dict(schedule.__opts__, {'schedule': {}}): self.assertDictEqual(schedule.enable_job('job1'), { 'comment': 'Job job1 does not exist.', 'result': False })
def test_enable_job(self): ''' Test if it enable a job in the minion's schedule. ''' with patch.dict(schedule.__opts__, {'schedule': {}, 'sock_dir': self.sock_dir}): mock = MagicMock(return_value=True) with patch.dict(schedule.__salt__, {'event.fire': mock}): _ret_value = {'complete': True, 'schedule': {}} with patch.object(SaltEvent, 'get_event', return_value=_ret_value): self.assertDictEqual(schedule.enable_job('job1'), {'comment': 'Job job1 does not exist.', 'result': False})
def test_enable_job(self): ''' Test if it enable a job in the minion's schedule. ''' with patch.dict(schedule.__opts__, {'schedule': {}, 'sock_dir': SOCK_DIR}): mock = MagicMock(return_value=True) with patch.dict(schedule.__salt__, {'event.fire': mock}): _ret_value = {'complete': True, 'schedule': {}} with patch.object(SaltEvent, 'get_event', return_value=_ret_value): self.assertDictEqual(schedule.enable_job('job1'), {'comment': 'Job job1 does not exist.', 'result': False})
def test_enable_job(self): """ Test if it enable a job in the minion's schedule. """ with patch.dict(schedule.__opts__, {"schedule": {}, "sock_dir": self.sock_dir}): mock = MagicMock(return_value=True) with patch.dict(schedule.__salt__, {"event.fire": mock}): _ret_value = {"complete": True, "schedule": {}} with patch.object(SaltEvent, "get_event", return_value=_ret_value): self.assertDictEqual( schedule.enable_job("job1"), {"comment": "Job job1 does not exist.", "result": False}, )