本文整理汇总了Python中mu.modes.python3.PythonMode.actions方法的典型用法代码示例。如果您正苦于以下问题:Python PythonMode.actions方法的具体用法?Python PythonMode.actions怎么用?Python PythonMode.actions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mu.modes.python3.PythonMode
的用法示例。
在下文中一共展示了PythonMode.actions方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_python_mode
# 需要导入模块: from mu.modes.python3 import PythonMode [as 别名]
# 或者: from mu.modes.python3.PythonMode import actions [as 别名]
def test_python_mode():
"""
Sanity check for setting up of the mode.
"""
editor = mock.MagicMock()
view = mock.MagicMock()
pm = PythonMode(editor, view)
assert pm.name == 'Python 3'
assert pm.description is not None
assert pm.icon == 'python'
assert pm.is_debugger is False
assert pm.editor == editor
assert pm.view == view
actions = pm.actions()
assert len(actions) == 3
assert actions[0]['name'] == 'run'
assert actions[0]['handler'] == pm.run_toggle
assert actions[1]['name'] == 'debug'
assert actions[1]['handler'] == pm.debug
assert actions[2]['name'] == 'repl'
assert actions[2]['handler'] == pm.toggle_repl