from pathlib import Path

SCRIPT = Path('scripts/probe_jasmin_invoice_print_api.py')


def test_probe_script_exists_and_is_read_only():
    src = SCRIPT.read_text(encoding='utf-8')
    assert 'Probe Jasmin invoice print API variants without creating documents' in src
    assert '/billing/invoices/{invoice_id}/print' in src
    assert 'await hc.get' in src
    assert 'await hc.post' not in src.lower()
    assert 'fromQuotation' not in src


def test_probe_checks_a4_and_writes_outputs():
    src = SCRIPT.read_text(encoding='utf-8')
    assert 'non_a4_or_unexpected_mediabox' in src
    assert 'MediaBox' in src
    assert 'clientflow_jasmin_invoice_print_api_probe' in src
    assert '--invoice-external-id' in src
    assert '--report-name' in src
