def test_disable_schedule(self): ''' Tests disabling the scheduler ''' self.schedule.opts = {'schedule': {'enabled': 'foo'}} Schedule.disable_schedule(self.schedule) self.assertFalse(self.schedule.opts['schedule']['enabled'])
def test_disable_schedule(self): ''' Tests disabling the scheduler ''' self.schedule.opts.update({'schedule': {'enabled': 'foo'}, 'pillar': {}}) Schedule.disable_schedule(self.schedule) self.assertFalse(self.schedule.opts['schedule']['enabled'])
def test_disable_schedule(self): ''' Tests disabling the scheduler ''' self.schedule.opts.update({'schedule': {'enabled': 'foo'}}) Schedule.disable_schedule(self.schedule) self.assertFalse(self.schedule.opts['schedule']['enabled'])
def test_disable_schedule(self): ''' Tests disabling the scheduler ''' self.schedule.opts = {'schedule': {'enabled': 'foo'}, 'sock_dir': SOCK_DIR} Schedule.disable_schedule(self.schedule) del self.schedule.opts['sock_dir'] self.assertFalse(self.schedule.opts['schedule']['enabled'])
def test_disable_schedule(schedule): """ Tests disabling the scheduler """ with patch("salt.utils.schedule.Schedule.persist", MagicMock(return_value=None)) as persist_mock: schedule.opts.update({"schedule": {"enabled": "foo"}, "pillar": {}}) Schedule.disable_schedule(schedule) assert not schedule.opts["schedule"]["enabled"] persist_mock.assert_called()
def test_disable_schedule(self): ''' Tests disabling the scheduler ''' with patch('salt.utils.schedule.Schedule.persist', MagicMock(return_value=None)) as persist_mock: self.schedule.opts.update({ 'schedule': { 'enabled': 'foo' }, 'pillar': {} }) Schedule.disable_schedule(self.schedule) self.assertFalse(self.schedule.opts['schedule']['enabled']) persist_mock.assert_called()