mirror of
https://github.com/ivan-usov-org/bec.git
synced 2025-04-22 02:20:02 +02:00
test(pdf_writer): added tests
This commit is contained in:
parent
fb7c84fcc6
commit
f64bdea797
@ -70,7 +70,7 @@ class PDFWriter:
|
||||
self._pdf.output(self.file, "F")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
if __name__ == "__main__": # pragma: no cover
|
||||
header = (
|
||||
" \n" * 3
|
||||
+ " ::: ::: ::: ::: :::: ::: ::::::::::: \n"
|
||||
|
21
bec_lib/tests/test_pdf_writer.py
Normal file
21
bec_lib/tests/test_pdf_writer.py
Normal file
@ -0,0 +1,21 @@
|
||||
import os
|
||||
|
||||
from bec_lib.pdf_writer import PDFWriter
|
||||
|
||||
|
||||
def test_pdf_writer():
|
||||
with PDFWriter("test_output.pdf") as file:
|
||||
file.write("Hello World")
|
||||
|
||||
assert os.path.exists("test_output.pdf")
|
||||
|
||||
os.remove("test_output.pdf")
|
||||
|
||||
|
||||
def test_pdf_writer_with_title():
|
||||
with PDFWriter("test_output.pdf", title="title") as file:
|
||||
file.write("Hello World")
|
||||
|
||||
assert os.path.exists("test_output.pdf")
|
||||
|
||||
os.remove("test_output.pdf")
|
Loading…
x
Reference in New Issue
Block a user