import pptx import pytest from src.backend.utils import pptx as pptx_utils @pytest.fixture def mock_presentation(): presentation = pptx.Presentation() presentation.slides.add_slide(presentation.slide_layouts[0]) return presentation def test_remove_shape(mock_presentation): """Test remove_shape function.""" shape_count = len(mock_presentation.slides[0].shapes) assert shape_count > 0, "Expected at least one shape." pptx_utils.remove_shape(mock_presentation.slides[0].shapes[0]) assert ( len(mock_presentation.slides[0].shapes) == shape_count - 1 ), "Expected one less shape." def test_remove_slide(mock_presentation): """Test remove_slide function.""" assert len(list(mock_presentation.slides)) == 1, "Expected one slide." pptx_utils.remove_slide(mock_presentation, 0) assert len(list(mock_presentation.slides)) == 0, "Expected no slides."