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