def test_pgzero_show_music(): """ The view is called to run the OS's file explorer for the given music path. """ editor = mock.MagicMock() view = mock.MagicMock() pm = PyGameZeroMode(editor, view) pm.show_music(None) music_dir = os.path.join(pm.workspace_dir(), 'music') view.open_directory_from_os.assert_called_once_with(music_dir)
def test_pgzero_show_music_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_music(None) music_dir = os.path.join(pm.workspace_dir(), "music") view.open_directory_from_os.assert_called_once_with(music_dir)
def test_pgzero_show_music(): """ The view is called to run the OS's file explorer for the given music path. """ editor = mock.MagicMock() view = mock.MagicMock() view.current_tab.path = os.path.join(tempfile.gettempdir(), "abc.py") pm = PyGameZeroMode(editor, view) pm.show_music(None) music_dir = os.path.join(os.path.dirname(view.current_tab.path), "music") view.open_directory_from_os.assert_called_once_with(music_dir)