本文整理汇总了Python中mu.modes.debugger.DebugMode.debug_on_breakpoint_enable方法的典型用法代码示例。如果您正苦于以下问题:Python DebugMode.debug_on_breakpoint_enable方法的具体用法?Python DebugMode.debug_on_breakpoint_enable怎么用?Python DebugMode.debug_on_breakpoint_enable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mu.modes.debugger.DebugMode
的用法示例。
在下文中一共展示了DebugMode.debug_on_breakpoint_enable方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_debug_on_breakpoint_enable
# 需要导入模块: from mu.modes.debugger import DebugMode [as 别名]
# 或者: from mu.modes.debugger.DebugMode import debug_on_breakpoint_enable [as 别名]
def test_debug_on_breakpoint_enable():
"""
Handle the signal that shows the debug runner has created a breakpoint.
"""
editor = mock.MagicMock()
view = mock.MagicMock()
mock_tab = mock.MagicMock()
view.current_tab = mock_tab
dm = DebugMode(editor, view)
mock_breakpoint = mock.MagicMock()
mock_breakpoint.line = 1
dm.debug_on_breakpoint_enable(mock_breakpoint)
mock_tab.markerAdd.assert_called_once_with(mock_breakpoint.line - 1,
mock_tab.BREAKPOINT_MARKER)
示例2: test_debug_on_breakpoint_enable_marker_already_exists
# 需要导入模块: from mu.modes.debugger import DebugMode [as 别名]
# 或者: from mu.modes.debugger.DebugMode import debug_on_breakpoint_enable [as 别名]
def test_debug_on_breakpoint_enable_marker_already_exists():
"""
Handle the signal that shows the debug runner has created a breakpoint
during the bootstrapping of the debug runner, so it doesn't add a second
marker at the same location as the pre-existing one that caused the
breakpoint to be created during bootstrapping.
"""
editor = mock.MagicMock()
view = mock.MagicMock()
mock_tab = mock.MagicMock()
mock_tab.markersAtLine.return_value = True
view.current_tab = mock_tab
dm = DebugMode(editor, view)
mock_breakpoint = mock.MagicMock()
mock_breakpoint.line = 1
dm.debug_on_breakpoint_enable(mock_breakpoint)
mock_tab.markerAdd.call_count == 0
示例3: test_debug_on_breakpoint_enable_different_tab
# 需要导入模块: from mu.modes.debugger import DebugMode [as 别名]
# 或者: from mu.modes.debugger.DebugMode import debug_on_breakpoint_enable [as 别名]
def test_debug_on_breakpoint_enable_different_tab():
"""
When the breakpoints are set on bootstrap, some of them may be for tabs
that are not the currently visible tab. In any case, when breakpoints are
set "on_breakpoint_enable" is called. This check ensures the marker is only
created IF the current tab has the same path as the filename associated
with the newly created breakpoint.
"""
editor = mock.MagicMock()
view = mock.MagicMock()
mock_tab = mock.MagicMock()
mock_tab.markersAtLine.return_value = False
mock_tab.path = 'foo'
view.current_tab = mock_tab
dm = DebugMode(editor, view)
mock_breakpoint = mock.MagicMock()
mock_breakpoint.filename = 'bar'
mock_breakpoint.line = 1
dm.debug_on_breakpoint_enable(mock_breakpoint)
assert mock_tab.markerAdd.call_count == 0