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


Python LoggedMessage.ofType方法代碼示例

本文整理匯總了Python中eliot.testing.LoggedMessage.ofType方法的典型用法代碼示例。如果您正苦於以下問題:Python LoggedMessage.ofType方法的具體用法?Python LoggedMessage.ofType怎麽用?Python LoggedMessage.ofType使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在eliot.testing.LoggedMessage的用法示例。


在下文中一共展示了LoggedMessage.ofType方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: error_status_logged

# 需要導入模塊: from eliot.testing import LoggedMessage [as 別名]
# 或者: from eliot.testing.LoggedMessage import ofType [as 別名]
def error_status_logged(case, logger):
    """
    Validate the error logging behavior of ``_sync_command_error_squashed``.
    """
    assertHasMessage(case, logger, ZFS_ERROR, {
        'status': 1,
        'zfs_command': 'python -c raise SystemExit(1)',
        'output': ''})
    case.assertEqual(len(LoggedMessage.ofType(logger.messages, ZFS_ERROR)), 1)
開發者ID:ClusterHQ,項目名稱:flocker,代碼行數:11,代碼來源:test_filesystems_zfs.py

示例2: no_such_executable_logged

# 需要導入模塊: from eliot.testing import LoggedMessage [as 別名]
# 或者: from eliot.testing.LoggedMessage import ofType [as 別名]
def no_such_executable_logged(case, logger):
    """
    Validate the error logging behavior of ``_sync_command_error_squashed``.
    """
    assertHasMessage(case, logger, ZFS_ERROR, {
        'status': 1,
        'zfs_command': 'nonsense garbage made up no such command',
        'output': '[Errno 2] No such file or directory'})
    case.assertEqual(len(LoggedMessage.ofType(logger.messages, ZFS_ERROR)), 1)
開發者ID:ClusterHQ,項目名稱:flocker,代碼行數:11,代碼來源:test_filesystems_zfs.py

示例3: assertOutputLogging

# 需要導入模塊: from eliot.testing import LoggedMessage [as 別名]
# 或者: from eliot.testing.LoggedMessage import ofType [as 別名]
 def assertOutputLogging(self, logger):
     """
     The L{IOutputExecutor} is invoked in the FSM's transition action
     context.
     """
     loggedTransition = LoggedAction.ofType(
         logger.messages, LOG_FSM_TRANSITION)[0]
     loggedAnimal = LoggedMessage.ofType(logger.messages, LOG_ANIMAL)[0]
     self.assertIn(loggedAnimal, loggedTransition.children)
開發者ID:cyli,項目名稱:machinist,代碼行數:11,代碼來源:test_fsm.py

示例4: error_status_logged

# 需要導入模塊: from eliot.testing import LoggedMessage [as 別名]
# 或者: from eliot.testing.LoggedMessage import ofType [as 別名]
def error_status_logged(case, logger):
    """
    Validate the error logging behavior of ``_sync_command_error_squashed``.
    """
    errors = LoggedMessage.ofType(logger.messages, ZFS_ERROR)
    assertContainsFields(
        case, errors[0].message,
        {'status': 1,
         'zfs_command': 'python -c raise SystemExit(1)',
         'output': '',
         u'message_type': 'filesystem:zfs:error',
         u'task_level': u'/'})
    case.assertEqual(1, len(errors))
開發者ID:cultofmetatron,項目名稱:flocker,代碼行數:15,代碼來源:test_filesystems_zfs.py

示例5: no_such_executable_logged

# 需要導入模塊: from eliot.testing import LoggedMessage [as 別名]
# 或者: from eliot.testing.LoggedMessage import ofType [as 別名]
def no_such_executable_logged(case, logger):
    """
    Validate the error logging behavior of ``_sync_command_error_squashed``.
    """
    errors = LoggedMessage.ofType(logger.messages, ZFS_ERROR)
    assertContainsFields(
        case, errors[0].message,
        {'status': 1,
         'zfs_command': 'nonsense garbage made up no such command',
         'output': '[Errno 2] No such file or directory',
         u'message_type': 'filesystem:zfs:error',
         u'task_level': u'/'})
    case.assertEqual(1, len(errors))
開發者ID:cultofmetatron,項目名稱:flocker,代碼行數:15,代碼來源:test_filesystems_zfs.py


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