Skip to content

Commit

Permalink
add test for /Kids
Browse files Browse the repository at this point in the history
  • Loading branch information
stefan6419846 authored Mar 30, 2024
1 parent 76bb2e0 commit 26ee189
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/test_page_labels.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,3 +103,13 @@ def test_index2label(caplog):
r.trailer["/Root"]["/PageLabels"][NameObject("/Kids")] = NullObject()
assert index2label(r, 1) == "2"
assert caplog.text != ""


@pytest.mark.enable_socket()
def test_index2label_kids():
url = "https://www.bk.admin.ch/dam/bk/de/dokumente/terminologie/publikation_25_jahre_rtd.pdf.download.pdf/Terminologie_Epochen,%20Schwerpunkte,%20Umsetzungen.pdf" # noqa: E501
r = PdfReader(BytesIO(get_data_from_url(url=url, name="index2label_kids.pdf")))
expected = [
"C1", "I", "II", "III", "IV", "V", "VI", "VII", "VIII", "IX", "X", "XI", "XII", "XIII", "XIV", "XV", "XVI", "XVII",
] + list(map(str, range(1, 284)))
assert r.page_labels == expected

0 comments on commit 26ee189

Please sign in to comment.