Skip to content

Commit

Permalink
TST: Invalid XML in xmp information (#1051)
Browse files Browse the repository at this point in the history
See #1030
  • Loading branch information
MartinThoma committed Jul 3, 2022
1 parent 5d213ea commit 4097db9
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/test_xmp.py
Expand Up @@ -7,6 +7,7 @@
import PyPDF2.generic
import PyPDF2.xmp
from PyPDF2 import PdfReader
from PyPDF2.errors import PdfReadError

from . import get_pdf_from_url

Expand Down Expand Up @@ -168,6 +169,15 @@ def test_dc_subject():
]


def test_issue585():
url = "https://github.com/mstamy2/PyPDF2/files/5536984/test.pdf"
name = "mstamy2-5536984.pdf"
reader = PdfReader(BytesIO(get_pdf_from_url(url, name=name)))
with pytest.raises(PdfReadError) as exc:
reader.xmp_metadata
assert exc.value.args[0].startswith("XML in XmpInformation was invalid")


# def test_getter_bag():
# f = PyPDF2.xmp._getter_bag("namespace", "name")
# class Tst: # to replace pdf
Expand Down

0 comments on commit 4097db9

Please sign in to comment.