예제 #1
0
 def test_disable_job(self):
     '''
     Tests disabling a job
     '''
     self.schedule.opts = {'schedule': {'name': {'enabled': 'foo'}}}
     Schedule.disable_job(self.schedule, 'name')
     self.assertFalse(self.schedule.opts['schedule']['name']['enabled'])
예제 #2
0
 def test_disable_job(self):
     '''
     Tests disabling a job
     '''
     self.schedule.opts.update({'schedule': {'name': {'enabled': 'foo'}}, 'pillar': {}})
     Schedule.disable_job(self.schedule, 'name')
     self.assertFalse(self.schedule.opts['schedule']['name']['enabled'])
예제 #3
0
 def test_disable_job_pillar(self):
     '''
     Tests ignoring disable a job in pillar
     '''
     self.schedule.opts.update({'pillar': {'schedule': {'name': {'enabled': True}}}, 'schedule': {}})
     Schedule.disable_job(self.schedule, 'name', persist=False)
     self.assertTrue(self.schedule.opts['pillar']['schedule']['name']['enabled'])
예제 #4
0
 def test_disable_job_pillar(self):
     '''
     Tests disabling a job in pillar
     '''
     self.schedule.opts.update({'pillar': {'schedule': {'name': {'enabled': 'foo'}}}})
     Schedule.disable_job(self.schedule, 'name', persist=False, where='pillar')
     self.assertFalse(self.schedule.opts['pillar']['schedule']['name']['enabled'])
예제 #5
0
 def test_disable_job(self):
     '''
     Tests disabling a job
     '''
     self.schedule.opts.update({'schedule': {'name': {'enabled': 'foo'}}})
     Schedule.disable_job(self.schedule, 'name')
     self.assertFalse(self.schedule.opts['schedule']['name']['enabled'])
예제 #6
0
 def test_disable_job_pillar(self):
     '''
     Tests disabling a job in pillar
     '''
     self.schedule.opts.update({'pillar': {'schedule': {'name': {'enabled': 'foo'}}}})
     Schedule.disable_job(self.schedule, 'name', persist=False, where='pillar')
     del self.schedule.opts['sock_dir']
     self.assertFalse(self.schedule.opts['pillar']['schedule']['name']['enabled'])
예제 #7
0
 def test_disable_job_pillar(self):
     '''
     Tests disabling a job in pillar
     '''
     self.schedule.opts = {'pillar': {'schedule': {'name': {'enabled': 'foo'}}},
                           'sock_dir': SOCK_DIR}
     Schedule.disable_job(self.schedule, 'name', persist=False, where='pillar')
     del self.schedule.opts['sock_dir']
     self.assertFalse(self.schedule.opts['pillar']['schedule']['name']['enabled'])
예제 #8
0
 def test_disable_job(self):
     '''
     Tests disabling a job
     '''
     self.schedule.opts = {'schedule': {'name': {'enabled': 'foo'}},
                           'sock_dir': SOCK_DIR}
     Schedule.disable_job(self.schedule, 'name')
     del self.schedule.opts['sock_dir']
     self.assertFalse(self.schedule.opts['schedule']['name']['enabled'])
예제 #9
0
 def test_disable_job_pillar(self):
     '''
     Tests disabling a job in pillar
     '''
     self.schedule.opts = {'pillar': {'schedule': {'name': {'enabled': 'foo'}}},
                           'sock_dir': SOCK_DIR}
     Schedule.disable_job(self.schedule, 'name', where='pillar')
     del self.schedule.opts['sock_dir']
     self.assertFalse(self.schedule.opts['pillar']['schedule']['name']['enabled'])
예제 #10
0
def test_disable_job(schedule):
    """
    Tests disabling a job
    """
    schedule.opts.update({
        "schedule": {
            "name": {
                "enabled": "foo"
            }
        },
        "pillar": {}
    })
    Schedule.disable_job(schedule, "name")
    assert not schedule.opts["schedule"]["name"]["enabled"]
예제 #11
0
 def test_disable_job(self):
     """
     Tests disabling a job
     """
     self.schedule.opts.update({
         "schedule": {
             "name": {
                 "enabled": "foo"
             }
         },
         "pillar": {}
     })
     Schedule.disable_job(self.schedule, "name")
     self.assertFalse(self.schedule.opts["schedule"]["name"]["enabled"])
예제 #12
0
def test_disable_job_pillar(schedule):
    """
    Tests ignoring disable a job in pillar
    """
    schedule.opts.update({
        "pillar": {
            "schedule": {
                "name": {
                    "enabled": True
                }
            }
        },
        "schedule": {}
    })
    Schedule.disable_job(schedule, "name", persist=False)
    assert schedule.opts["pillar"]["schedule"]["name"]["enabled"]