import pytest

from qz.text_extractor import TextExtractor


def test_text_extractor_initialization():
    extractor = TextExtractor()
    assert isinstance(extractor, TextExtractor)


def test_extract_text_from_pdf(sample_pdf_path):
    extractor = TextExtractor()
    text = extractor.extract_text_from_pdf(sample_pdf_path)
    assert isinstance(text, str)


def test_nonexistent_pdf():
    extractor = TextExtractor()
    with pytest.raises(FileNotFoundError):
        extractor.extract_text_from_pdf("nonexistent.pdf")
