def test_modify_job_pillar(self): ''' Tests ignoring modification of job from pillar ''' schedule = {'foo': 'bar'} self.schedule.opts.update({'schedule': {}, 'pillar': {'schedule': {'name': 'baz'}}}) ret = copy.deepcopy(self.schedule.opts) Schedule.modify_job(self.schedule, 'name', schedule, persist=False) self.assertEqual(self.schedule.opts, ret)
def test_modify_job(self): ''' Tests modifying a job in the scheduler ''' schedule = {'schedule': {'foo': 'bar'}} ret = {'schedule': {'foo': 'bar', 'name': {'schedule': {'foo': 'bar'}}}} self.schedule.opts = {'schedule': {'foo': 'bar'}} Schedule.modify_job(self.schedule, 'name', schedule) self.assertEqual(self.schedule.opts, ret)
def test_modify_job_pillar(self): ''' Tests modifying a job in the scheduler in pillar ''' schedule = {'foo': 'bar'} ret = {'pillar': {'schedule': {'name': {'foo': 'bar'}}}} self.schedule.opts = {'pillar': {'schedule': {'name': {'foo': 'bar'}}}} Schedule.modify_job(self.schedule, 'name', schedule, where='pillar') self.assertEqual(self.schedule.opts, ret)
def test_modify_job_not_exists(self): ''' Tests modifying a job in the scheduler if jobs not exists ''' schedule = {'foo': 'bar'} self.schedule.opts.update({'schedule': {}, 'pillar': {}}) ret = copy.deepcopy(self.schedule.opts) ret.update({'schedule': {'name': {'foo': 'bar'}}}) Schedule.modify_job(self.schedule, 'name', schedule) self.assertEqual(self.schedule.opts, ret)
def test_modify_job_not_exists(schedule): """ Tests modifying a job in the scheduler if jobs not exists """ schedule_dict = {"foo": "bar"} schedule.opts.update({"schedule": {}, "pillar": {}}) ret = copy.deepcopy(schedule.opts) ret.update({"schedule": {"name": {"foo": "bar"}}}) Schedule.modify_job(schedule, "name", schedule_dict) assert schedule.opts == ret
def test_modify_job_pillar(self): ''' Tests modifying a job in the scheduler in pillar ''' schedule = {'foo': 'bar'} ret = copy.deepcopy(self.schedule.opts) ret.update({'pillar': {'schedule': {'name': {'foo': 'bar'}}}}) self.schedule.opts.update({'pillar': {'schedule': {'name': {'foo': 'bar'}}}}) Schedule.modify_job(self.schedule, 'name', schedule, persist=False, where='pillar') self.assertEqual(self.schedule.opts, ret)
def test_modify_job(self): ''' Tests modifying a job in the scheduler ''' schedule = {'schedule': {'foo': 'bar'}} ret = copy.deepcopy(self.schedule.opts) ret.update({'schedule': {'foo': 'bar', 'name': {'schedule': {'foo': 'bar'}}}}) self.schedule.opts.update({'schedule': {'foo': 'bar'}}) Schedule.modify_job(self.schedule, 'name', schedule) self.assertEqual(self.schedule.opts, ret)
def test_modify_job_not_exists(self): """ Tests modifying a job in the scheduler if jobs not exists """ schedule = {"foo": "bar"} self.schedule.opts.update({"schedule": {}, "pillar": {}}) ret = copy.deepcopy(self.schedule.opts) ret.update({"schedule": {"name": {"foo": "bar"}}}) Schedule.modify_job(self.schedule, "name", schedule) self.assertEqual(self.schedule.opts, ret)
def test_modify_job_pillar(self): ''' Tests modifying a job in the scheduler in pillar ''' schedule = {'foo': 'bar'} ret = copy.deepcopy(DEFAULT_CONFIG) ret.update({'pillar': {'schedule': {'name': {'foo': 'bar'}}}}) self.schedule.opts.update({'pillar': {'schedule': {'name': {'foo': 'bar'}}}}) Schedule.modify_job(self.schedule, 'name', schedule, persist=False, where='pillar') self.assertEqual(self.schedule.opts, ret)
def test_modify_job(self): ''' Tests modifying a job in the scheduler ''' schedule = {'schedule': {'foo': 'bar'}} ret = copy.deepcopy(DEFAULT_CONFIG) ret.update({'schedule': {'foo': 'bar', 'name': {'schedule': {'foo': 'bar'}}}}) self.schedule.opts.update({'schedule': {'foo': 'bar'}}) Schedule.modify_job(self.schedule, 'name', schedule) self.assertEqual(self.schedule.opts, ret)
def test_modify_job_pillar(self): ''' Tests modifying a job in the scheduler in pillar ''' schedule = {'foo': 'bar'} ret = {'pillar': {'schedule': {'name': {'foo': 'bar'}}}} self.schedule.opts = {'pillar': {'schedule': {'name': {'foo': 'bar'}}}, 'sock_dir': SOCK_DIR} Schedule.modify_job(self.schedule, 'name', schedule, persist=False, where='pillar') del self.schedule.opts['sock_dir'] self.assertEqual(self.schedule.opts, ret)
def test_modify_job_pillar(schedule): """ Tests ignoring modification of job from pillar """ schedule_dict = {"foo": "bar"} schedule.opts.update({ "schedule": {}, "pillar": { "schedule": { "name": "baz" } } }) ret = copy.deepcopy(schedule.opts) Schedule.modify_job(schedule, "name", schedule_dict, persist=False) assert schedule.opts == ret
def test_modify_job_pillar(self): """ Tests ignoring modification of job from pillar """ schedule = {"foo": "bar"} self.schedule.opts.update({ "schedule": {}, "pillar": { "schedule": { "name": "baz" } } }) ret = copy.deepcopy(self.schedule.opts) Schedule.modify_job(self.schedule, "name", schedule, persist=False) self.assertEqual(self.schedule.opts, ret)
def test_modify_job_pillar(self): ''' Tests modifying a job in the scheduler in pillar ''' schedule = {'foo': 'bar'} ret = {'pillar': {'schedule': {'name': {'foo': 'bar'}}}} self.schedule.opts = { 'pillar': { 'schedule': { 'name': { 'foo': 'bar' } } }, 'sock_dir': SOCK_DIR } Schedule.modify_job(self.schedule, 'name', schedule, persist=False, where='pillar') del self.schedule.opts['sock_dir'] self.assertEqual(self.schedule.opts, ret)