import asyncio import os import tempfile import unittest from unittest.mock import MagicMock, patch from bs4 import BeautifulSoup from olmocr.bench.tests import TestType from olmocr.synth.mine_html_templates import render_pdf_with_playwright class TestIncompleteContent(unittest.TestCase): def test_pg39(self): html = """ History of Computing
9/2/2010

HISTORY OF COMPUTING

Fall 2010 - CSE 111

PRE 1642

3000 BC – Abacus is invented in Babylonia

800 AD - Chinese begin to use zero.

← Exo
← Span
← Rods
← Frame
From 800 to 1641 some kinda important stuff happens in math – algebra, calculus, geometry, etc.
""" with tempfile.TemporaryDirectory() as td: result = asyncio.run(render_pdf_with_playwright(html, os.path.join(td, "temp.pdf"), 768, 1024)) # Somehow we need to error out and show that this page didn't render fully self.assertFalse(result.success) if __name__ == "__main__": unittest.main()