當前位置: 首頁>>代碼示例>>Python>>正文


Python GlobalCommandHookRegistry.load_project_hooks方法代碼示例

本文整理匯總了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")
開發者ID:bhuvan,項目名稱:incubator-aurora,代碼行數:10,代碼來源:test_command_hooks.py

示例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)")
開發者ID:bhuvan,項目名稱:incubator-aurora,代碼行數:10,代碼來源:test_command_hooks.py

示例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])
開發者ID:bhuvan,項目名稱:incubator-aurora,代碼行數:7,代碼來源:test_command_hooks.py

示例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
開發者ID:bhuvan,項目名稱:incubator-aurora,代碼行數:7,代碼來源:test_command_hooks.py


注:本文中的apache.aurora.client.cli.command_hooks.GlobalCommandHookRegistry.load_project_hooks方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。