def parse(filename='example.html'): return hocr.parse(path.join(BASE_DIR, filename))
def test_parse_from_stream(): with open(path.join(BASE_DIR, 'example.html'), 'rb') as stream: pages = hocr.parse(stream) assert len(pages) == len(parse('example.html'))