当前位置: 首页>>代码示例>>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;未经允许,请勿转载。