示例#1
0
 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'])
示例#2
0
 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'])
示例#3
0
 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'])
示例#4
0
 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'])
示例#5
0
 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'])
示例#6
0
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()
示例#7
0
    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()