Merging upstream version 0.10.0.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
8e8c5588ab
commit
bc8a047c8c
7 changed files with 128 additions and 73 deletions
|
@ -1,4 +1,5 @@
|
|||
import io
|
||||
import re
|
||||
|
||||
import pydyf
|
||||
|
||||
|
@ -704,11 +705,34 @@ def test_text():
|
|||
''')
|
||||
|
||||
|
||||
def test_identifier():
|
||||
def test_no_identifier():
|
||||
document = pydyf.PDF()
|
||||
pdf = io.BytesIO()
|
||||
document.write(pdf, identifier=False)
|
||||
assert re.search(
|
||||
b'/ID \\[\\((?P<hash>[0-9a-f]{32})\\) \\((?P=hash)\\)\\]',
|
||||
pdf.getvalue()
|
||||
) is None
|
||||
|
||||
|
||||
def test_default_identifier():
|
||||
document = pydyf.PDF()
|
||||
pdf = io.BytesIO()
|
||||
document.write(pdf, identifier=True)
|
||||
assert re.search(
|
||||
b'/ID \\[\\((?P<hash>[0-9a-f]{32})\\) \\((?P=hash)\\)\\]',
|
||||
pdf.getvalue()
|
||||
) is not None
|
||||
|
||||
|
||||
def test_custom_identifier():
|
||||
document = pydyf.PDF()
|
||||
pdf = io.BytesIO()
|
||||
document.write(pdf, identifier=b'abc')
|
||||
assert b'abc' in pdf.getvalue()
|
||||
assert re.search(
|
||||
b'/ID \\[\\(abc\\) \\(([0-9a-f]{32})\\)\\]',
|
||||
pdf.getvalue()
|
||||
) is not None
|
||||
|
||||
|
||||
def test_version():
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue