当前位置: 首页>>代码示例>>Python>>正文


Python interfaces.Stacktrace类代码示例

本文整理汇总了Python中sentry.interfaces.Stacktrace的典型用法代码示例。如果您正苦于以下问题:Python Stacktrace类的具体用法?Python Stacktrace怎么用?Python Stacktrace使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Stacktrace类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_get_hash_ignores_filename_if_https

 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'])
开发者ID:DouweM,项目名称:sentry,代码行数:7,代码来源:tests.py

示例2: test_serialize_returns_frames

 def test_serialize_returns_frames(self):
     interface = Stacktrace(frames=[{
         'lineno': 1,
         'filename': 'foo.py',
     }])
     result = interface.serialize()
     self.assertTrue('frames' in result)
开发者ID:Crowdbooster,项目名称:sentry,代码行数:7,代码来源:tests.py

示例3: test_get_composite_hash_uses_exception_value_if_no_type_or_stack

 def test_get_composite_hash_uses_exception_value_if_no_type_or_stack(self):
     interface = Stacktrace(frames=[])
     interface_exc = Exception(value='bar')
     result = interface.get_composite_hash({
         'sentry.interfaces.Exception': interface_exc,
     })
     self.assertEquals(result[-1], 'bar')
开发者ID:crockpotveggies,项目名称:BurntVeggies,代码行数:7,代码来源:tests.py

示例4: test_get_hash_with_only_required_vars

 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])
开发者ID:Crowdbooster,项目名称:sentry,代码行数:7,代码来源:tests.py

示例5: test_get_composite_hash_uses_exception_if_present

 def test_get_composite_hash_uses_exception_if_present(self):
     interface = Stacktrace(
         frames=[{"context_line": "foo bar", "lineno": 1, "filename": "foo.py", "function": "bar"}]
     )
     interface_exc = Exception(type="exception", value="bar")
     result = interface.get_composite_hash({"sentry.interfaces.Exception": interface_exc})
     self.assertEquals(result[-1], "exception")
开发者ID:CaseCommonsDevOps,项目名称:sentry,代码行数:7,代码来源:tests.py

示例6: test_to_html_response

 def test_to_html_response(self, get_traceback):
     event = mock.Mock(spec=Event())
     event.message = 'foo'
     get_traceback.return_value = 'bar'
     interface = Stacktrace(frames=[{'lineno': 1, 'filename': 'foo.py'}])
     result = interface.to_html(event)
     get_traceback.assert_called_once_with(event, newest_first=False)
     self.assertTrue('<div class="module">' in result)
开发者ID:Supy,项目名称:sentry,代码行数:8,代码来源:tests.py

示例7: test_get_hash_uses_module_over_filename

 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])
开发者ID:Crowdbooster,项目名称:sentry,代码行数:8,代码来源:tests.py

示例8: test_get_hash_uses_function_over_lineno

 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'])
开发者ID:Crowdbooster,项目名称:sentry,代码行数:8,代码来源:tests.py

示例9: test_get_traceback_response

 def test_get_traceback_response(self, get_stacktrace):
     event = mock.Mock(spec=Event())
     event.message = "foo"
     get_stacktrace.return_value = "bar"
     interface = Stacktrace(frames=[{"lineno": 1, "filename": "foo.py"}])
     result = interface.get_traceback(event)
     get_stacktrace.assert_called_once_with(event, newest_first=None)
     self.assertEquals(result, "foo\n\nbar")
开发者ID:CaseCommonsDevOps,项目名称:sentry,代码行数:8,代码来源:tests.py

示例10: test_get_traceback_response

 def test_get_traceback_response(self, get_stacktrace):
     event = mock.Mock(spec=Event)
     event.message = 'foo'
     get_stacktrace.return_value = 'bar'
     interface = Stacktrace(frames=[])
     result = interface.get_traceback(event)
     get_stacktrace.assert_called_once_with(event)
     self.assertEquals(result, 'foo\n\nbar')
开发者ID:Crowdbooster,项目名称:sentry,代码行数:8,代码来源:tests.py

示例11: test_get_hash_sanitizes_block_functions

 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'])
开发者ID:crockpotveggies,项目名称:BurntVeggies,代码行数:8,代码来源:tests.py

示例12: test_to_html_response

 def test_to_html_response(self, get_traceback):
     event = mock.Mock(spec=Event)
     event.message = 'foo'
     get_traceback.return_value = 'bar'
     interface = Stacktrace(frames=[])
     result = interface.to_html(event)
     get_traceback.assert_called_once_with(event)
     self.assertTrue('<div id="traceback" class="module">' in result)
开发者ID:Crowdbooster,项目名称:sentry,代码行数:8,代码来源:tests.py

示例13: test_get_hash_sanitizes_erb_templates

 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>',
     ])
开发者ID:crockpotveggies,项目名称:BurntVeggies,代码行数:10,代码来源:tests.py

示例14: test_get_composite_hash_uses_exception_if_present

 def test_get_composite_hash_uses_exception_if_present(self):
     interface = Stacktrace(frames=[{
         'context_line': 'foo bar',
         'lineno': 1,
         'filename': 'foo.py',
         'function': 'bar'
     }])
     interface_exc = Exception(type='exception', value='bar')
     result = interface.get_composite_hash({
         'sentry.interfaces.Exception': interface_exc,
     })
     self.assertEquals(result[-1], 'exception')
开发者ID:Supy,项目名称:sentry,代码行数:12,代码来源:tests.py

示例15: test_to_html_render_call

 def test_to_html_render_call(self, render_to_string, get_traceback):
     event = mock.Mock(spec=Event)
     get_traceback.return_value = 'bar'
     interface = Stacktrace(frames=[])
     result = interface.to_html(event)
     get_traceback.assert_called_once_with(event)
     render_to_string.assert_called_once_with('sentry/partial/interfaces/stacktrace.html', {
         'event': event,
         'frames': [],
         'stacktrace': 'bar',
     })
     self.assertEquals(result, render_to_string.return_value)
开发者ID:Crowdbooster,项目名称:sentry,代码行数:12,代码来源:tests.py


注:本文中的sentry.interfaces.Stacktrace类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。