本文整理汇总了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)
示例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)
示例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)
示例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))
示例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))