Esempio n. 1
0
def test_pgzero_show_sounds():
    """
    The view is called to run the OS's file explorer for the given sounds path.
    """
    editor = mock.MagicMock()
    view = mock.MagicMock()
    pm = PyGameZeroMode(editor, view)
    pm.show_sounds(None)
    sounds_dir = os.path.join(pm.workspace_dir(), 'sounds')
    view.open_directory_from_os.assert_called_once_with(sounds_dir)
Esempio n. 2
0
def test_pgzero_show_sounds():
    """
    The view is called to run the OS's file explorer for the given sounds path.
    """
    editor = mock.MagicMock()
    view = mock.MagicMock()
    pm = PyGameZeroMode(editor, view)
    pm.show_sounds(None)
    sounds_dir = os.path.join(pm.workspace_dir(), 'sounds')
    view.open_directory_from_os.assert_called_once_with(sounds_dir)
Esempio n. 3
0
def test_pgzero_show_sounds_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_sounds(None)
    sound_dir = os.path.join(pm.workspace_dir(), "sounds")
    view.open_directory_from_os.assert_called_once_with(sound_dir)
Esempio n. 4
0
def test_pgzero_show_sounds():
    """
    The view is called to run the OS's file explorer for the given sounds path.
    """
    editor = mock.MagicMock()
    view = mock.MagicMock()
    view.current_tab.path = os.path.join(tempfile.gettempdir(), "abc.py")
    pm = PyGameZeroMode(editor, view)
    pm.show_sounds(None)
    sounds_dir = os.path.join(os.path.dirname(view.current_tab.path), "sounds")
    view.open_directory_from_os.assert_called_once_with(sounds_dir)