Skip to content

Commit 3970d4b

Browse files
Merge pull request steam-bell-92#1139 from jyotish6699/test-empty-markdown-pdf
test: add coverage for empty markdown file conversion
2 parents a880084 + 1b98f88 commit 3970d4b

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

tests/test_markdown_to_pdf.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,20 @@ def test_end_to_end_conversion(self):
186186
self.assertTrue(os.path.exists(output_file))
187187
self.assertGreater(os.path.getsize(output_file), 0)
188188

189+
def test_empty_markdown_file(self):
190+
"""Verify conversion of an empty Markdown file creates a valid PDF."""
191+
with tempfile.TemporaryDirectory() as tmpdir:
192+
input_file = os.path.join(tmpdir, "empty.md")
193+
output_file = os.path.join(tmpdir, "empty.pdf")
194+
195+
with open(input_file, "w", encoding="utf-8") as f:
196+
f.write("")
197+
198+
convert_markdown_to_pdf(input_file, output_file, "Classic")
199+
200+
self.assertTrue(os.path.exists(output_file))
201+
self.assertGreater(os.path.getsize(output_file), 0)
202+
189203

190204
if __name__ == "__main__":
191205
unittest.main()

0 commit comments

Comments
 (0)