本文整理汇总了Python中sentry.event_manager.EventManager.should_filter方法的典型用法代码示例。如果您正苦于以下问题:Python EventManager.should_filter方法的具体用法?Python EventManager.should_filter怎么用?Python EventManager.should_filter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sentry.event_manager.EventManager
的用法示例。
在下文中一共展示了EventManager.should_filter方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_should_filter_message
# 需要导入模块: from sentry.event_manager import EventManager [as 别名]
# 或者: from sentry.event_manager.EventManager import should_filter [as 别名]
def test_should_filter_message(self, mock_is_valid_error_message):
TestItem = namedtuple('TestItem', 'value formatted result')
items = [
TestItem(
{'type': 'UnfilteredException'},
'UnfilteredException',
True,
),
TestItem(
{'value': 'This is an unfiltered exception.'},
'This is an unfiltered exception.',
True,
),
TestItem(
{'type': 'UnfilteredException', 'value': 'This is an unfiltered exception.'},
'UnfilteredException: This is an unfiltered exception.',
True,
),
TestItem(
{'type': 'FilteredException', 'value': 'This is a filtered exception.'},
'FilteredException: This is a filtered exception.',
False,
),
]
data = {
'exception': {
'values': [item.value for item in items]
},
}
manager = EventManager(data, project=self.project)
mock_is_valid_error_message.side_effect = [item.result for item in items]
assert manager.should_filter() == (True, FilterStatKeys.ERROR_MESSAGE)
assert mock_is_valid_error_message.call_args_list == [
mock.call(self.project, item.formatted) for item in items]