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)
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)
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)
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)