本文整理匯總了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