本文整理汇总了Python中mu.modes.microbit.MicrobitMode.remove_fs方法的典型用法代码示例。如果您正苦于以下问题:Python MicrobitMode.remove_fs方法的具体用法?Python MicrobitMode.remove_fs怎么用?Python MicrobitMode.remove_fs使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mu.modes.microbit.MicrobitMode
的用法示例。
在下文中一共展示了MicrobitMode.remove_fs方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_remove_fs_no_fs
# 需要导入模块: from mu.modes.microbit import MicrobitMode [as 别名]
# 或者: from mu.modes.microbit.MicrobitMode import remove_fs [as 别名]
def test_remove_fs_no_fs():
"""
Removing a non-existent file system raises a RuntimeError.
"""
view = mock.MagicMock()
editor = mock.MagicMock()
mm = MicrobitMode(editor, view)
mm.fs = None
with pytest.raises(RuntimeError):
mm.remove_fs()
示例2: test_remove_fs
# 需要导入模块: from mu.modes.microbit import MicrobitMode [as 别名]
# 或者: from mu.modes.microbit.MicrobitMode import remove_fs [as 别名]
def test_remove_fs():
"""
Removing the file system results in the expected state.
"""
view = mock.MagicMock()
view.remove_repl = mock.MagicMock()
editor = mock.MagicMock()
mm = MicrobitMode(editor, view)
mm.fs = True
mm.remove_fs()
assert view.remove_filesystem.call_count == 1
assert mm.fs is None
示例3: test_toggle_files_off
# 需要导入模块: from mu.modes.microbit import MicrobitMode [as 别名]
# 或者: from mu.modes.microbit.MicrobitMode import remove_fs [as 别名]
def test_toggle_files_off():
"""
If the fs is on, toggle if off.
"""
view = mock.MagicMock()
editor = mock.MagicMock()
mm = MicrobitMode(editor, view)
mm.remove_fs = mock.MagicMock()
mm.repl = None
mm.fs = True
mm.toggle_files(None)
assert mm.remove_fs.call_count == 1