本文整理汇总了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)