diff options
author | Daniel Baumann <mail@daniel-baumann.ch> | 2022-06-19 07:06:23 +0000 |
---|---|---|
committer | Daniel Baumann <mail@daniel-baumann.ch> | 2022-06-19 07:06:34 +0000 |
commit | 5af1e7262d704ec79cc40ecc2f61bcd8d1dd02d7 (patch) | |
tree | 5f908593917c99e6f9ea8c65861a51e30dbfa19c /tests | |
parent | Releasing debian version 0.1.2-4. (diff) | |
download | pydyf-5af1e7262d704ec79cc40ecc2f61bcd8d1dd02d7.tar.xz pydyf-5af1e7262d704ec79cc40ecc2f61bcd8d1dd02d7.zip |
Merging upstream version 0.2.0.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
Diffstat (limited to 'tests')
-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>' |