def test_document_find_simple(simple_document_path): """Test search capabilities.""" pdf = PDF(simple_document_path, 1) pdf.load() resp = pdf.find_text_page('Multivio') assert resp == [{ 'BBox': { 'x1': 196.189, 'x2': 254.84358934, 'y1': 165.65651239999994, 'y2': 180.96100299999992 }, 'page': 1, 'text': "Multivio: Project description" }, { 'BBox': { 'x1': 124.80199999999999, 'y1': 287.6239556, 'x2': 161.88678224000006, 'y2': 296.4707444 }, 'page': 1, 'text': 'Multivio is an Internet-based application ' + 'for browsing and accessing digital doc-' }]
def test_document_find(simple_document_path): """Test search capabilities.""" pdf = PDF(simple_document_path, 1) pdf.load() resp = pdf.find_text_page(str('Multivio is')) assert resp == [{ 'BBox': { 'x1': 124.80199999999999, 'x2': 171.2336935600001, 'y1': 287.6239556, 'y2': 296.4707444 }, 'page': 1, 'text': 'Multivio is an Internet-based ' + 'application for browsing and accessing digital doc-' }]
def test_document_find_max_result(simple_document_path): """Test search capabilities.""" pdf = PDF(simple_document_path, 1) pdf.load() resp = pdf.find_text_page('a') assert len(resp) == 127