コード例 #1
0
def test_pgzero_show_fonts():
    """
    The view is called to run the OS's file explorer for the given fonts path.
    """
    editor = mock.MagicMock()
    view = mock.MagicMock()
    pm = PyGameZeroMode(editor, view)
    pm.show_fonts(None)
    fonts_dir = os.path.join(pm.workspace_dir(), 'fonts')
    view.open_directory_from_os.assert_called_once_with(fonts_dir)
コード例 #2
0
ファイル: test_pygamezero.py プロジェクト: ZanderBrown/mu
def test_pgzero_show_fonts():
    """
    The view is called to run the OS's file explorer for the given fonts path.
    """
    editor = mock.MagicMock()
    view = mock.MagicMock()
    pm = PyGameZeroMode(editor, view)
    pm.show_fonts(None)
    fonts_dir = os.path.join(pm.workspace_dir(), 'fonts')
    view.open_directory_from_os.assert_called_once_with(fonts_dir)
コード例 #3
0
def test_pgzero_show_fonts_no_file():
    """
    Run the OS file explorer for the workspace if no file is current.
    """
    editor = mock.MagicMock()
    view = mock.MagicMock()
    view.current_tab = None
    pm = PyGameZeroMode(editor, view)
    pm.show_fonts(None)
    font_dir = os.path.join(pm.workspace_dir(), "fonts")
    view.open_directory_from_os.assert_called_once_with(font_dir)
コード例 #4
0
def test_pgzero_show_fonts():
    """
    The view is called to run the OS's file explorer for the given fonts path.
    """
    editor = mock.MagicMock()
    view = mock.MagicMock()
    view.current_tab.path = os.path.join(tempfile.gettempdir(), "abc.py")
    pm = PyGameZeroMode(editor, view)
    pm.show_fonts(None)
    fonts_dir = os.path.join(os.path.dirname(view.current_tab.path), "fonts")
    view.open_directory_from_os.assert_called_once_with(fonts_dir)