本文整理汇总了Python中sentry.interfaces.stacktrace.Frame类的典型用法代码示例。如果您正苦于以下问题:Python Frame类的具体用法?Python Frame怎么用?Python Frame使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Frame类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_context_with_nan
def test_context_with_nan(self):
self.assertEquals(
Frame.to_python({
'filename': 'x',
'vars': {
'x': float('inf')
},
}).vars,
{'x': '<inf>'},
)
self.assertEquals(
Frame.to_python({
'filename': 'x',
'vars': {
'x': float('-inf')
},
}).vars,
{'x': '<-inf>'},
)
self.assertEquals(
Frame.to_python({
'filename': 'x',
'vars': {
'x': float('nan')
},
}).vars,
{'x': '<nan>'},
)
示例2: test_get_hash_sanitizes_versioned_filenames
def test_get_hash_sanitizes_versioned_filenames(self):
# This is Ruby specific
interface = Frame.to_python(
{
'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 = Frame.to_python(
{
'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 %>',
]
)
示例3: test_get_hash_ignores_filename_if_https
def test_get_hash_ignores_filename_if_https(self):
interface = Frame.to_python({
'context_line': 'hello world',
'filename': 'https://foo.com/foo.py',
})
result = interface.get_hash()
self.assertEquals(result, ['hello world'])
示例4: test_get_hash_with_only_required_vars
def test_get_hash_with_only_required_vars(self):
interface = Frame.to_python({
'lineno': 1,
'filename': 'foo.py',
})
result = interface.get_hash()
self.assertEquals(result, ['foo.py', 1])
示例5: test_get_hash_sanitizes_erb_templates
def test_get_hash_sanitizes_erb_templates(self):
# This is Ruby specific
interface = Frame.to_python(
{"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>"])
示例6: test_get_hash_sanitizes_versioned_filenames
def test_get_hash_sanitizes_versioned_filenames(self):
# This is Ruby specific
interface = Frame.to_python(
{
"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 = Frame.to_python(
{"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 %>"])
示例7: test_get_hash_uses_function_over_lineno
def test_get_hash_uses_function_over_lineno(self):
interface = Frame.to_python({
'lineno': 1,
'filename': 'foo.py',
'function': 'bar'
})
result = interface.get_hash()
self.assertEquals(result, ['foo.py', 'bar'])
示例8: test_get_hash_uses_module_over_filename
def test_get_hash_uses_module_over_filename(self):
interface = Frame.to_python({
'lineno': 1,
'filename': 'foo.py',
'module': 'foo'
})
result = interface.get_hash()
self.assertEquals(result, ['foo', 1])
示例9: test_get_hash_ignores_filename_if_blob
def test_get_hash_ignores_filename_if_blob(self):
interface = Frame.to_python(
{
'filename': 'blob:http://example.com/7f7aaadf-a006-4217-9ed5-5fbf8585c6c0',
}
)
result = interface.get_hash()
self.assertEquals(result, [])
示例10: test_get_hash_ignores_safari_native_code
def test_get_hash_ignores_safari_native_code(self):
interface = Frame.to_python({
'abs_path': '[native code]',
'filename': '[native code]',
'function': 'forEach',
})
result = interface.get_hash()
self.assertEquals(result, [])
示例11: test_get_hash_sanitizes_block_functions
def test_get_hash_sanitizes_block_functions(self):
# This is Ruby specific
interface = Frame.to_python({
'filename': 'foo.py',
'function': 'block in _conditional_callback_around_233',
})
result = interface.get_hash()
self.assertEquals(result, ['foo.py', 'block'])
示例12: test_get_hash_ignores_java8_lambda_module
def test_get_hash_ignores_java8_lambda_module(self):
interface = Frame.to_python({
'module': 'foo.bar.Baz$$Lambda$40/1673859467',
'function': 'call',
})
result = interface.get_hash()
self.assertEquals(result, [
'<module>',
'call',
])
示例13: test_get_hash_ignores_java8_lambda_function
def test_get_hash_ignores_java8_lambda_function(self):
interface = Frame.to_python({
'module': 'foo.bar.Baz',
'function': 'lambda$work$1',
})
result = interface.get_hash()
self.assertEquals(result, [
'foo.bar.Baz',
'<function>',
])
示例14: test_get_hash_ignores_extra_ENHANCED_clojure_classes
def test_get_hash_ignores_extra_ENHANCED_clojure_classes(self):
interface = Frame.to_python({
'module': 'sentry_clojure_example.core$_main$fn__1539$fn__1540',
'function': 'invoke'
})
result = interface.get_hash()
self.assertEquals(result, [
'sentry_clojure_example.core$_main$fn__<auto>$fn__<auto>',
'invoke',
])
示例15: test_get_hash_sanitizes_erb_templates
def test_get_hash_sanitizes_erb_templates(self):
# This is Ruby specific
interface = Frame.to_python({
'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>',
])