本文整理汇总了Python中CustomServiceOrchestrator.CustomServiceOrchestrator.resolve_hook_script_path方法的典型用法代码示例。如果您正苦于以下问题:Python CustomServiceOrchestrator.resolve_hook_script_path方法的具体用法?Python CustomServiceOrchestrator.resolve_hook_script_path怎么用?Python CustomServiceOrchestrator.resolve_hook_script_path使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CustomServiceOrchestrator.CustomServiceOrchestrator
的用法示例。
在下文中一共展示了CustomServiceOrchestrator.resolve_hook_script_path方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_resolve_hook_script_path
# 需要导入模块: from CustomServiceOrchestrator import CustomServiceOrchestrator [as 别名]
# 或者: from CustomServiceOrchestrator.CustomServiceOrchestrator import resolve_hook_script_path [as 别名]
def test_resolve_hook_script_path(self, FileCache_mock, isfile_mock):
FileCache_mock.return_value = None
dummy_controller = MagicMock()
orchestrator = CustomServiceOrchestrator(self.config, dummy_controller)
# Testing None param
res1 = orchestrator.resolve_hook_script_path(None, "prefix", "command",
"script_type")
self.assertEqual(res1, None)
# Testing existing hook script
isfile_mock.return_value = True
res2 = orchestrator.resolve_hook_script_path("/hooks_dir/", "prefix", "command",
"script_type")
self.assertEqual(res2, ('/hooks_dir/prefix-command/scripts/hook.py',
'/hooks_dir/prefix-command'))
# Testing not existing hook script
isfile_mock.return_value = False
res3 = orchestrator.resolve_hook_script_path("/hooks_dir/", "prefix", "command",
"script_type")
self.assertEqual(res3, None)