diff options
author | Daniel Baumann <mail@daniel-baumann.ch> | 2022-06-19 07:06:18 +0000 |
---|---|---|
committer | Daniel Baumann <mail@daniel-baumann.ch> | 2022-06-19 07:06:18 +0000 |
commit | d1a4b99d1127b881225cfb38f943493de1a042e3 (patch) | |
tree | e937c9ee98cc103a730cd74fc6566a7d904e02c4 /tests/test_pydyf.py | |
parent | Adding upstream version 0.1.2. (diff) | |
download | pydyf-d1a4b99d1127b881225cfb38f943493de1a042e3.tar.xz pydyf-d1a4b99d1127b881225cfb38f943493de1a042e3.zip |
Adding upstream version 0.2.0.upstream/0.2.0
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
Diffstat (limited to 'tests/test_pydyf.py')
-rw-r--r-- | tests/test_pydyf.py | 20 |
1 files changed, 18 insertions, 2 deletions
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'<feff006400e90066>' |