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


Python Stacktrace.to_html方法代码示例

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


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

示例1: test_to_html_response

# 需要导入模块: from sentry.interfaces import Stacktrace [as 别名]
# 或者: from sentry.interfaces.Stacktrace import to_html [as 别名]
 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,代码行数:10,代码来源:tests.py

示例2: test_to_html_response

# 需要导入模块: from sentry.interfaces import Stacktrace [as 别名]
# 或者: from sentry.interfaces.Stacktrace import to_html [as 别名]
 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,代码行数:10,代码来源:tests.py

示例3: test_to_html_render_call

# 需要导入模块: from sentry.interfaces import Stacktrace [as 别名]
# 或者: from sentry.interfaces.Stacktrace import to_html [as 别名]
 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,代码行数:14,代码来源:tests.py

示例4: test_to_html_render_call

# 需要导入模块: from sentry.interfaces import Stacktrace [as 别名]
# 或者: from sentry.interfaces.Stacktrace import to_html [as 别名]
 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=[{'lineno': 1, 'filename': 'foo.py'}])
     result = interface.to_html(event)
     get_traceback.assert_called_once_with(event, newest_first=False)
     render_to_string.assert_called_once_with('sentry/partial/interfaces/stacktrace.html', {
         'event': event,
         'frames': [{'function': None, 'abs_path': None, 'start_lineno': None, 'lineno': 1, 'context': [], 'vars': [], 'in_app': True, 'filename': 'foo.py'}],
         'stacktrace': 'bar',
         'system_frames': 0,
         'newest_first': False,
     })
     self.assertEquals(result, render_to_string.return_value)
开发者ID:Supy,项目名称:sentry,代码行数:16,代码来源:tests.py

示例5: test_to_html_render_call

# 需要导入模块: from sentry.interfaces import Stacktrace [as 别名]
# 或者: from sentry.interfaces.Stacktrace import to_html [as 别名]
 def test_to_html_render_call(self, get_frame_context, render_to_string, get_traceback):
     event = mock.Mock(spec=Event())
     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)
     get_frame_context.assert_called_once_with(interface.frames[0], event=event, is_public=False)
     render_to_string.assert_called_once_with('sentry/partial/interfaces/stacktrace.html', {
         'event': event,
         'frames': [get_frame_context.return_value],
         'stacktrace': 'bar',
         'system_frames': 0,
         'newest_first': False,
         'is_public': False,
     })
     self.assertEquals(result, render_to_string.return_value)
开发者ID:DouweM,项目名称:sentry,代码行数:18,代码来源:tests.py

示例6: test_to_html_render_call

# 需要导入模块: from sentry.interfaces import Stacktrace [as 别名]
# 或者: from sentry.interfaces.Stacktrace import to_html [as 别名]
 def test_to_html_render_call(self, get_frame_context, render_to_string, get_traceback):
     event = mock.Mock(spec=Event())
     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)
     get_frame_context.assert_called_once_with(event=event, is_public=False)
     render_to_string.assert_called_once_with(
         "sentry/partial/interfaces/stacktrace.html",
         {
             "event": event,
             "frames": [get_frame_context.return_value],
             "stacktrace": "bar",
             "stack_id": "stacktrace_1",
             "system_frames": 0,
             "newest_first": False,
             "is_public": False,
             "first_frame_omitted": None,
             "last_frame_omitted": None,
         },
     )
     self.assertEquals(result, render_to_string.return_value)
开发者ID:CaseCommonsDevOps,项目名称:sentry,代码行数:24,代码来源:tests.py


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