Esempio n. 1
0
 def test_reload_no_schedule_in_opts(self):
     '''
     Tests reloading the schedule from saved schedule that does not
     contain a schedule key and neither does self.schedule.opts
     '''
     saved = {'foo': 'bar'}
     ret = {'schedule': {'foo': 'bar'}}
     Schedule.reload(self.schedule, saved)
     self.assertEqual(self.schedule.opts, ret)
Esempio n. 2
0
 def test_reload_schedule_in_saved_but_not_opts(self):
     '''
     Tests reloading the schedule from saved schedule that contains
     a schedule key, but self.schedule.opts does not
     '''
     saved = {'schedule': {'foo': 'bar'}}
     ret = {'schedule': {'schedule': {'foo': 'bar'}}}
     Schedule.reload(self.schedule, saved)
     self.assertEqual(self.schedule.opts, ret)
Esempio n. 3
0
 def test_reload_update_schedule_key(self):
     '''
     Tests reloading the schedule from saved schedule where both the
     saved schedule and self.schedule.opts contain a schedule key
     '''
     saved = {'schedule': {'foo': 'bar'}}
     ret = {'schedule': {'foo': 'bar', 'hello': 'world'}}
     self.schedule.opts = {'schedule': {'hello': 'world'}}
     Schedule.reload(self.schedule, saved)
     self.assertEqual(self.schedule.opts, ret)
Esempio n. 4
0
 def test_reload_update_schedule_no_key(self):
     '''
     Tests reloading the schedule from saved schedule that does not
     contain a schedule key but self.schedule.opts does not
     '''
     saved = {'foo': 'bar'}
     ret = {'schedule': {'foo': 'bar', 'hello': 'world'}}
     self.schedule.opts = {'schedule': {'hello': 'world'}}
     Schedule.reload(self.schedule, saved)
     self.assertEqual(self.schedule.opts, ret)
Esempio n. 5
0
 def test_reload_no_schedule_in_opts(self):
     '''
     Tests reloading the schedule from saved schedule that does not
     contain a schedule key and neither does self.schedule.opts
     '''
     saved = {'foo': 'bar'}
     ret = copy.deepcopy(self.schedule.opts)
     ret['schedule'] = {'foo': 'bar'}
     self.schedule.opts.pop('schedule', None)
     Schedule.reload(self.schedule, saved)
     self.assertEqual(self.schedule.opts, ret)
Esempio n. 6
0
 def test_reload_schedule_in_saved_but_not_opts(self):
     '''
     Tests reloading the schedule from saved schedule that contains
     a schedule key, but self.schedule.opts does not
     '''
     saved = {'schedule': {'foo': 'bar'}}
     ret = copy.deepcopy(self.schedule.opts)
     ret['schedule'] = {'foo': 'bar'}
     self.schedule.opts.pop('schedule', None)
     Schedule.reload(self.schedule, saved)
     self.assertEqual(self.schedule.opts, ret)
Esempio n. 7
0
 def test_reload_update_schedule_key(self):
     """
     Tests reloading the schedule from saved schedule where both the
     saved schedule and self.schedule.opts contain a schedule key
     """
     saved = {"schedule": {"foo": "bar"}}
     ret = copy.deepcopy(self.schedule.opts)
     ret.update({"schedule": {"foo": "bar", "hello": "world"}})
     self.schedule.opts.update({"schedule": {"hello": "world"}})
     Schedule.reload(self.schedule, saved)
     self.assertEqual(self.schedule.opts, ret)
Esempio n. 8
0
 def test_reload_update_schedule_no_key(self):
     """
     Tests reloading the schedule from saved schedule that does not
     contain a schedule key but self.schedule.opts does
     """
     saved = {"foo": "bar"}
     ret = copy.deepcopy(self.schedule.opts)
     ret.update({"schedule": {"foo": "bar", "hello": "world"}})
     self.schedule.opts.update({"schedule": {"hello": "world"}})
     Schedule.reload(self.schedule, saved)
     self.assertEqual(self.schedule.opts, ret)
Esempio n. 9
0
 def test_reload_no_schedule_in_opts(self):
     """
     Tests reloading the schedule from saved schedule that does not
     contain a schedule key and neither does self.schedule.opts
     """
     saved = {"foo": "bar"}
     ret = copy.deepcopy(self.schedule.opts)
     ret["schedule"] = {"foo": "bar"}
     self.schedule.opts.pop("schedule", None)
     Schedule.reload(self.schedule, saved)
     self.assertEqual(self.schedule.opts, ret)
Esempio n. 10
0
 def test_reload_schedule_in_saved_but_not_opts(self):
     """
     Tests reloading the schedule from saved schedule that contains
     a schedule key, but self.schedule.opts does not
     """
     saved = {"schedule": {"foo": "bar"}}
     ret = copy.deepcopy(self.schedule.opts)
     ret["schedule"] = {"foo": "bar"}
     self.schedule.opts.pop("schedule", None)
     Schedule.reload(self.schedule, saved)
     self.assertEqual(self.schedule.opts, ret)
Esempio n. 11
0
 def test_reload_schedule_in_saved_but_not_opts(self):
     '''
     Tests reloading the schedule from saved schedule that contains
     a schedule key, but self.schedule.opts does not
     '''
     saved = {'schedule': {'foo': 'bar'}}
     ret = copy.deepcopy(self.schedule.opts)
     ret['schedule'] = {'foo': 'bar'}
     self.schedule.opts.pop('schedule', None)
     Schedule.reload(self.schedule, saved)
     self.assertEqual(self.schedule.opts, ret)
Esempio n. 12
0
 def test_reload_no_schedule_in_opts(self):
     '''
     Tests reloading the schedule from saved schedule that does not
     contain a schedule key and neither does self.schedule.opts
     '''
     saved = {'foo': 'bar'}
     ret = copy.deepcopy(self.schedule.opts)
     ret['schedule'] = {'foo': 'bar'}
     self.schedule.opts.pop('schedule', None)
     Schedule.reload(self.schedule, saved)
     self.assertEqual(self.schedule.opts, ret)
Esempio n. 13
0
 def test_reload_update_schedule_no_key(self):
     '''
     Tests reloading the schedule from saved schedule that does not
     contain a schedule key but self.schedule.opts does
     '''
     saved = {'foo': 'bar'}
     ret = copy.deepcopy(self.schedule.opts)
     ret.update({'schedule': {'foo': 'bar', 'hello': 'world'}})
     self.schedule.opts.update({'schedule': {'hello': 'world'}})
     Schedule.reload(self.schedule, saved)
     self.assertEqual(self.schedule.opts, ret)
Esempio n. 14
0
 def test_reload_update_schedule_key(self):
     '''
     Tests reloading the schedule from saved schedule where both the
     saved schedule and self.schedule.opts contain a schedule key
     '''
     saved = {'schedule': {'foo': 'bar'}}
     ret = copy.deepcopy(self.schedule.opts)
     ret.update({'schedule': {'foo': 'bar', 'hello': 'world'}})
     self.schedule.opts.update({'schedule': {'hello': 'world'}})
     Schedule.reload(self.schedule, saved)
     self.assertEqual(self.schedule.opts, ret)
Esempio n. 15
0
 def test_reload_no_schedule_in_opts(self):
     '''
     Tests reloading the schedule from saved schedule that does not
     contain a schedule key and neither does self.schedule.opts
     '''
     saved = copy.deepcopy(DEFAULT_CONFIG)
     saved.update({'schedule': {'foo': 'bar'}})
     ret = copy.deepcopy(DEFAULT_CONFIG)
     ret.update({'schedule': {'foo': 'bar'}})
     Schedule.reload(self.schedule, saved)
     self.assertEqual(self.schedule.opts, ret)