本文整理匯總了Python中apache.aurora.client.cli.command_hooks.GlobalCommandHookRegistry.load_project_hooks方法的典型用法代碼示例。如果您正苦於以下問題:Python GlobalCommandHookRegistry.load_project_hooks方法的具體用法?Python GlobalCommandHookRegistry.load_project_hooks怎麽用?Python GlobalCommandHookRegistry.load_project_hooks使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類apache.aurora.client.cli.command_hooks.GlobalCommandHookRegistry
的用法示例。
在下文中一共展示了GlobalCommandHookRegistry.load_project_hooks方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_dynamic_hook_exec_error
# 需要導入模塊: from apache.aurora.client.cli.command_hooks import GlobalCommandHookRegistry [as 別名]
# 或者: from apache.aurora.client.cli.command_hooks.GlobalCommandHookRegistry import load_project_hooks [as 別名]
def test_dynamic_hook_exec_error(self):
with patch("logging.warn") as log_patch:
GlobalCommandHookRegistry.reset()
GlobalCommandHookRegistry.load_project_hooks(
"./src/test/python/apache/aurora/client/cli/hook_test_data/exec_error")
log_patch.assert_called_with("Warning: error loading hooks file "
"./src/test/python/apache/aurora/client/cli/hook_test_data/exec_error/AuroraHooks: "
"integer division or modulo by zero")
示例2: test_dynamic_hook_syntax_error
# 需要導入模塊: from apache.aurora.client.cli.command_hooks import GlobalCommandHookRegistry [as 別名]
# 或者: from apache.aurora.client.cli.command_hooks.GlobalCommandHookRegistry import load_project_hooks [as 別名]
def test_dynamic_hook_syntax_error(self):
with patch("logging.warn") as log_patch:
GlobalCommandHookRegistry.reset()
GlobalCommandHookRegistry.load_project_hooks(
"./src/test/python/apache/aurora/client/cli/hook_test_data/bad_syntax")
log_patch.assert_called_with("Error compiling hooks file "
"./src/test/python/apache/aurora/client/cli/hook_test_data/bad_syntax/AuroraHooks: "
"invalid syntax (AuroraHooks, line 15)")
示例3: test_successful_dynamic_hook
# 需要導入模塊: from apache.aurora.client.cli.command_hooks import GlobalCommandHookRegistry [as 別名]
# 或者: from apache.aurora.client.cli.command_hooks.GlobalCommandHookRegistry import load_project_hooks [as 別名]
def test_successful_dynamic_hook(self):
GlobalCommandHookRegistry.reset()
hook_locals = GlobalCommandHookRegistry.load_project_hooks(
"./src/test/python/apache/aurora/client/cli")
self.generic_test_successful_hook(hook_locals["hooks"][0])
示例4: test_load_dynamic_hooks
# 需要導入模塊: from apache.aurora.client.cli.command_hooks import GlobalCommandHookRegistry [as 別名]
# 或者: from apache.aurora.client.cli.command_hooks.GlobalCommandHookRegistry import load_project_hooks [as 別名]
def test_load_dynamic_hooks(self):
GlobalCommandHookRegistry.reset()
hook_locals = GlobalCommandHookRegistry.load_project_hooks(
"./src/test/python/apache/aurora/client/cli")
assert hook_locals["hooks"][0] in GlobalCommandHookRegistry.COMMAND_HOOKS