本文整理汇总了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)
示例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)
示例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)
示例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)
示例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)
示例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)