From 5af1e7262d704ec79cc40ecc2f61bcd8d1dd02d7 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 19 Jun 2022 09:06:23 +0200 Subject: Merging upstream version 0.2.0. Signed-off-by: Daniel Baumann --- tests/test_pydyf.py | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/test_pydyf.py b/tests/test_pydyf.py index 1e758a5..83c260c 100644 --- a/tests/test_pydyf.py +++ b/tests/test_pydyf.py @@ -1,3 +1,5 @@ +import io + import pydyf from . import assert_pixels @@ -283,10 +285,10 @@ def test_transform(): document = pydyf.PDF() draw = pydyf.Stream() + draw.transform(1, 0, 0, 1, 1, 1) draw.move_to(2, 2) draw.set_line_width(2) draw.line_to(2, 5) - draw.transform(1, 0, 0, 1, 1, 1) draw.stroke() document.add_object(draw) @@ -694,7 +696,7 @@ def test_text(): KKKKKKKKKK KKKKKKKKKK KKKKKKKKKK - __________ + zzzzzzzzzz __________ __________ __________ @@ -702,6 +704,20 @@ def test_text(): ''') +def test_identifier(): + document = pydyf.PDF() + pdf = io.BytesIO() + document.write(pdf, identifier=b'abc') + assert b'abc' in pdf.getvalue() + + +def test_version(): + document = pydyf.PDF() + pdf = io.BytesIO() + document.write(pdf, version=b'2.0') + assert b'2.0' in pdf.getvalue() + + def test_string_encoding(): assert pydyf.String('abc').data == b'(abc)' assert pydyf.String('déf').data == b'' -- cgit v1.2.3