本文整理匯總了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))