"""Full-dependency smoke checks for the deployed application's Linux target.""" import math import struct import wave from pathlib import Path from PIL import Image import pytest import cv2 from Image_Processing.convert_and_display_grayscale import convert_and_display from Image_Processing.resize_all_images_in_folder import resize_all_images_in_folder from pypdf import PdfReader, PdfWriter def test_poppler_pdf_conversion(tmp_path): from File_Handling.convert_pdf_to_images import convert_pdf_to_images source = tmp_path / "source.pdf" writer = PdfWriter() writer.add_blank_page(width=100, height=150) with source.open("wb") as handle: writer.write(handle) images = convert_pdf_to_images(str(source)) assert len(images) == 1 assert isinstance(images[0], Image.Image) assert images[0].width > 0 def test_libreoffice_docx_conversion(tmp_path): from docx import Document from File_Handling.convert_word_doc_to_pdf import convert_word_doc_to_pdf source = tmp_path / "example.docx" destination = tmp_path / "example.pdf" document = Document() document.add_paragraph("Smoke test for Word-to-PDF.") document.save(source) convert_word_doc_to_pdf(str(source), str(destination)) assert destination.is_file() assert len(PdfReader(str(destination)).pages) >= 1 from File_Handling.convert_pdf_to_word import convert_pdf_to_word restored = tmp_path / "roundtrip.docx" convert_pdf_to_word(str(destination), str(restored)) assert restored.is_file() assert restored.stat().st_size > 100 def test_speech_file_output(tmp_path): from Audio_Speech_Processing.text_to_speech import text_to_speech destination = tmp_path / "speech.wav" text_to_speech("Testing speech generation.", output_path=str(destination)) assert destination.is_file() assert destination.stat().st_size > 44 def test_pitch_analyser_returns_statistics(tmp_path): from Audio_Speech_Processing.analyse_pitch import analyse_pitch source = tmp_path / "tone.wav" sample_rate = 22050 with wave.open(str(source), "wb") as output: output.setnchannels(1) output.setsampwidth(2) output.setframerate(sample_rate) frames = ( struct.pack("