本文整理汇总了Python中sentry.interfaces.Stacktrace.get_hash方法的典型用法代码示例。如果您正苦于以下问题:Python Stacktrace.get_hash方法的具体用法?Python Stacktrace.get_hash怎么用?Python Stacktrace.get_hash使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sentry.interfaces.Stacktrace
的用法示例。
在下文中一共展示了Stacktrace.get_hash方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_get_hash_ignores_filename_if_https
# 需要导入模块: from sentry.interfaces import Stacktrace [as 别名]
# 或者: from sentry.interfaces.Stacktrace import get_hash [as 别名]
def test_get_hash_ignores_filename_if_https(self):
interface = Stacktrace(frames=[{
'context_line': 'hello world',
'filename': 'https://foo.com/foo.py',
}])
result = interface.get_hash()
self.assertEquals(result, ['hello world'])
示例2: test_get_hash_with_only_required_vars
# 需要导入模块: from sentry.interfaces import Stacktrace [as 别名]
# 或者: from sentry.interfaces.Stacktrace import get_hash [as 别名]
def test_get_hash_with_only_required_vars(self):
interface = Stacktrace(frames=[{
'lineno': 1,
'filename': 'foo.py',
}])
result = interface.get_hash()
self.assertEquals(result, ['foo.py', 1])
示例3: test_get_hash_uses_function_over_lineno
# 需要导入模块: from sentry.interfaces import Stacktrace [as 别名]
# 或者: from sentry.interfaces.Stacktrace import get_hash [as 别名]
def test_get_hash_uses_function_over_lineno(self):
interface = Stacktrace(frames=[{
'lineno': 1,
'filename': 'foo.py',
'function': 'bar'
}])
result = interface.get_hash()
self.assertEquals(result, ['foo.py', 'bar'])
示例4: test_get_hash_uses_module_over_filename
# 需要导入模块: from sentry.interfaces import Stacktrace [as 别名]
# 或者: from sentry.interfaces.Stacktrace import get_hash [as 别名]
def test_get_hash_uses_module_over_filename(self):
interface = Stacktrace(frames=[{
'lineno': 1,
'filename': 'foo.py',
'module': 'foo'
}])
result = interface.get_hash()
self.assertEquals(result, ['foo', 1])
示例5: test_get_hash_sanitizes_block_functions
# 需要导入模块: from sentry.interfaces import Stacktrace [as 别名]
# 或者: from sentry.interfaces.Stacktrace import get_hash [as 别名]
def test_get_hash_sanitizes_block_functions(self):
# This is Ruby specific
interface = Stacktrace(frames=[{
'filename': 'foo.py',
'function': 'block in _conditional_callback_around_233',
}])
result = interface.get_hash()
self.assertEquals(result, ['foo.py', 'block'])
示例6: test_get_hash_sanitizes_erb_templates
# 需要导入模块: from sentry.interfaces import Stacktrace [as 别名]
# 或者: from sentry.interfaces.Stacktrace import get_hash [as 别名]
def test_get_hash_sanitizes_erb_templates(self):
# This is Ruby specific
interface = Stacktrace(frames=[{
'filename': 'foo.html.erb',
'function': '_foo_html_erb__3327151541118998292_70361296749460',
}])
result = interface.get_hash()
self.assertEquals(result, [
'foo.html.erb', '_foo_html_erb__<anon>_<anon>',
])
示例7: test_get_hash_sanitizes_versioned_filenames
# 需要导入模块: from sentry.interfaces import Stacktrace [as 别名]
# 或者: from sentry.interfaces.Stacktrace import get_hash [as 别名]
def test_get_hash_sanitizes_versioned_filenames(self):
# This is Ruby specific
interface = Stacktrace(frames=[{
'filename': '/data/foo/releases/20140114151955/app/views/foo.html.erb',
'context_line': '<% if @hotels.size > 0 %>',
}])
result = interface.get_hash()
self.assertEquals(result, [
'/data/foo/releases/<version>/app/views/foo.html.erb',
'<% if @hotels.size > 0 %>',
])
interface = Stacktrace(frames=[{
'filename': '20140114151955/app/views/foo.html.erb',
'context_line': '<% if @hotels.size > 0 %>',
}])
result = interface.get_hash()
self.assertEquals(result, [
'<version>/app/views/foo.html.erb',
'<% if @hotels.size > 0 %>',
])
示例8: test_get_hash_uses_context_line_over_function
# 需要导入模块: from sentry.interfaces import Stacktrace [as 别名]
# 或者: from sentry.interfaces.Stacktrace import get_hash [as 别名]
def test_get_hash_uses_context_line_over_function(self):
interface = Stacktrace(
frames=[{"context_line": "foo bar", "lineno": 1, "filename": "foo.py", "function": "bar"}]
)
result = interface.get_hash()
self.assertEquals(result, ["foo.py", "foo bar"])
示例9: test_get_hash_uses_module_over_filename
# 需要导入模块: from sentry.interfaces import Stacktrace [as 别名]
# 或者: from sentry.interfaces.Stacktrace import get_hash [as 别名]
def test_get_hash_uses_module_over_filename(self):
interface = Stacktrace(frames=[{"lineno": 1, "filename": "foo.py", "module": "foo"}])
result = interface.get_hash()
self.assertEquals(result, ["foo", 1])
示例10: test_get_hash_ignores_filename_if_abs_path_is_http
# 需要导入模块: from sentry.interfaces import Stacktrace [as 别名]
# 或者: from sentry.interfaces.Stacktrace import get_hash [as 别名]
def test_get_hash_ignores_filename_if_abs_path_is_http(self):
interface = Stacktrace(
frames=[{"context_line": "hello world", "abs_path": "https://foo.com/foo.py", "filename": "foo.py"}]
)
result = interface.get_hash()
self.assertEquals(result, ["hello world"])
示例11: test_get_hash_with_only_required_vars
# 需要导入模块: from sentry.interfaces import Stacktrace [as 别名]
# 或者: from sentry.interfaces.Stacktrace import get_hash [as 别名]
def test_get_hash_with_only_required_vars(self):
interface = Stacktrace(frames=[{"lineno": 1, "filename": "foo.py"}])
result = interface.get_hash()
self.assertEquals(result, ["foo.py", 1])