def lines(self, text): return list(select_lines(text))
def test_returns_empty_list_when_no_matches_with_callback(self, text) -> None: callbacks = [lambda box: "z" in box.get_text()] result = list(select_lines(text, *callbacks)) assert len(result) == 0
def test_filters_results_with_multiple_callbacks(self, text) -> None: callbacks = [lambda box: "b" in box.get_text(), lambda box: box.y0 > 500, lambda box: box.y1 < 600] result = list(select_lines(text, *callbacks)) assert len(result) == 4
def test_filters_results_with_callback_function(self, text) -> None: result = list(select_lines(text, lambda ln: "a" in ln.get_text())) assert len(result) == 46
def test_returns_lines_from_multiple_pages(self, pages) -> None: result = select_lines(pages) for line in result: assert isinstance(line, LTTextLine)
def test_returns_lines_from_single_textbox(self, textboxes) -> None: result = select_lines(textboxes[0]) for line in result: assert isinstance(line, LTTextLine)
def test_returns_iterable(self, text) -> None: result = select_lines(text) assert isinstance(result, Iterable)