Esempio n. 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'])
Esempio n. 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'])
Esempio n. 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'])
Esempio n. 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'])
Esempio n. 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'])
Esempio n. 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()
Esempio n. 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()