Skip to content

Commit 3e5c15c

Browse files
committed
added more specific tests
#949
1 parent f45a3f9 commit 3e5c15c

4 files changed

+22
-2
lines changed
1.14 KB
Binary file not shown.
1.13 KB
Binary file not shown.
1.13 KB
Binary file not shown.

test/test_annotations.py

+22-2
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ def test_ink_annotation(tmp_path):
155155
assert_pdf_equal(pdf, HERE / "ink_annotation.pdf", tmp_path)
156156

157157

158-
def test_free_text_annotation(tmp_path):
158+
def test_free_text_annotation_all_parameters(tmp_path):
159159
pdf = FPDF()
160160
pdf.add_page()
161161
pdf.set_font("Helvetica", size=24)
@@ -169,4 +169,24 @@ def test_free_text_annotation(tmp_path):
169169
w=150,
170170
h=15,
171171
)
172-
assert_pdf_equal(pdf, HERE / "free_text_annotation.pdf", tmp_path)
172+
assert_pdf_equal(pdf, HERE / "free_text_annotation_all_parameters.pdf", tmp_path)
173+
174+
175+
def test_free_text_annotation_text_parameter(tmp_path):
176+
pdf = FPDF()
177+
pdf.add_page()
178+
pdf.set_font("Helvetica", size=24)
179+
pdf.text(x=50, y=50, text="Some text.")
180+
pdf.set_font_size(12)
181+
pdf.free_text_annotation(text="This is a free text annotation.")
182+
assert_pdf_equal(pdf, HERE / "free_text_annotation_text_parameter.pdf", tmp_path)
183+
184+
185+
def test_free_text_annotation_width_parameter(tmp_path):
186+
pdf = FPDF()
187+
pdf.add_page()
188+
pdf.set_font("Helvetica", size=24)
189+
pdf.text(x=50, y=50, text="Some text.")
190+
pdf.set_font_size(12)
191+
pdf.free_text_annotation(text="This is a free text annotation.", w=80)
192+
assert_pdf_equal(pdf, HERE / "free_text_annotation_width_parameter.pdf", tmp_path)

0 commit comments

Comments
 (0)