本文整理汇总了Python中nailgun.task.helpers.TaskHelper.sanitize_task_output方法的典型用法代码示例。如果您正苦于以下问题:Python TaskHelper.sanitize_task_output方法的具体用法?Python TaskHelper.sanitize_task_output怎么用?Python TaskHelper.sanitize_task_output使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nailgun.task.helpers.TaskHelper
的用法示例。
在下文中一共展示了TaskHelper.sanitize_task_output方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: check_task_name_and_sanitized_data
# 需要导入模块: from nailgun.task.helpers import TaskHelper [as 别名]
# 或者: from nailgun.task.helpers.TaskHelper import sanitize_task_output [as 别名]
def check_task_name_and_sanitized_data(self, pos, logger, task_name,
one_parameter=False):
"""Test task name against known value
Check sanitized data doesn't contain keys which are absent in
white_list
:param pos: position of call parameters inside logger.call_args_list,
(negative value: -1 - last call, -2 - pre-last call, etc.)
:param logger: mock object for logger method
:param task_name: expected task name
:param one_parameter: whether given call must go with one parameter
"""
log_args = logger.call_args_list
task = log_args[pos][0][0]
self.assertEqual(task.name, task_name)
if len(log_args[pos][0]) == 2:
log_record = log_args[pos][0][1]
if task_name in task_output_white_list:
self.check_keys_included(
task_output_white_list[task_name],
TaskHelper.sanitize_task_output(task.cache, log_record))
else:
self.assertIsNone(
TaskHelper.sanitize_task_output(task.cache, log_record))
else:
self.assertTrue(one_parameter)