CtrlK
BlogDocsLog inGet started
Tessl Logo

jbaruch/speaker-toolkit

Six-skill presentation system: ingest talks into a rhetoric vault, run interactive clarification, generate a speaker profile, create presentations that match your documented patterns, produce the deck illustrations + thumbnail visual layer, and publish talk pages to a Jekyll shownotes site. Includes a 102-entry Presentation Patterns taxonomy (91 observable, 11 unobservable go-live items) for scoring, brainstorming, and go-live preparation.

86

1.24x
Quality

92%

Does it follow best practices?

Impact

86%

1.24x

Average score across 26 eval scenarios

SecuritybySnyk

Advisory

Suggest reviewing before use

Overview
Quality
Evals
Security
Files

test_export_pdf.pytests/

"""Tests for export-pdf.py — PDF export via LibreOffice."""

import os
import shutil

import pytest

from conftest import make_deck


@pytest.mark.skipif(not shutil.which("libreoffice"), reason="LibreOffice not installed")
def test_libreoffice_export(export_pdf, tmp_path):
    """LibreOffice converts a PPTX to PDF successfully."""
    prs = make_deck(3)
    pptx_path = str(tmp_path / "deck.pptx")
    prs.save(pptx_path)

    pdf_path = str(tmp_path / "deck.pdf")
    result = export_pdf.try_libreoffice(pptx_path, pdf_path)
    assert result is True
    assert os.path.isfile(pdf_path)
    assert os.path.getsize(pdf_path) > 100


@pytest.mark.skipif(not shutil.which("libreoffice"), reason="LibreOffice not installed")
def test_libreoffice_custom_output_path(export_pdf, tmp_path):
    """PDF output goes to the specified path, not alongside the PPTX."""
    prs = make_deck(2)
    pptx_path = str(tmp_path / "source" / "deck.pptx")
    os.makedirs(os.path.dirname(pptx_path), exist_ok=True)
    prs.save(pptx_path)

    pdf_path = str(tmp_path / "dest" / "output.pdf")
    os.makedirs(os.path.dirname(pdf_path), exist_ok=True)
    result = export_pdf.try_libreoffice(pptx_path, pdf_path)
    assert result is True
    assert os.path.isfile(pdf_path)


@pytest.mark.skipif(not shutil.which("libreoffice"), reason="LibreOffice not installed")
def test_libreoffice_missing_file(export_pdf, tmp_path):
    """Non-existent PPTX produces no PDF output."""
    pdf_path = str(tmp_path / "out.pdf")
    export_pdf.try_libreoffice(
        str(tmp_path / "missing.pptx"),
        pdf_path,
    )
    # Whether it returns True or False depends on LibreOffice version,
    # but a missing input should never produce a valid PDF
    assert not os.path.isfile(pdf_path)

CHANGELOG.md

README.md

tessl.json

tile.json