本文整理匯總了Python中salt.utils.schedule.Schedule.reload方法的典型用法代碼示例。如果您正苦於以下問題:Python Schedule.reload方法的具體用法?Python Schedule.reload怎麽用?Python Schedule.reload使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類salt.utils.schedule.Schedule
的用法示例。
在下文中一共展示了Schedule.reload方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_reload_schedule_in_saved_but_not_opts
# 需要導入模塊: from salt.utils.schedule import Schedule [as 別名]
# 或者: from salt.utils.schedule.Schedule import reload [as 別名]
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)
示例2: test_reload_no_schedule_in_opts
# 需要導入模塊: from salt.utils.schedule import Schedule [as 別名]
# 或者: from salt.utils.schedule.Schedule import reload [as 別名]
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)
示例3: test_reload_update_schedule_no_key
# 需要導入模塊: from salt.utils.schedule import Schedule [as 別名]
# 或者: from salt.utils.schedule.Schedule import reload [as 別名]
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)
示例4: test_reload_update_schedule_key
# 需要導入模塊: from salt.utils.schedule import Schedule [as 別名]
# 或者: from salt.utils.schedule.Schedule import reload [as 別名]
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)
示例5: test_reload_schedule_in_saved_but_not_opts
# 需要導入模塊: from salt.utils.schedule import Schedule [as 別名]
# 或者: from salt.utils.schedule.Schedule import reload [as 別名]
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)
示例6: test_reload_no_schedule_in_opts
# 需要導入模塊: from salt.utils.schedule import Schedule [as 別名]
# 或者: from salt.utils.schedule.Schedule import reload [as 別名]
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)