def test_main(remote_resource, tmpdir, capsys):
images_path = str(tmpdir.mkdir('images'))
# First, pull down some test data
zip_path = remote_resource('language/ocr_nl-images-small.zip', tmpdir)
# Extract it to the image directory
with zipfile.ZipFile(zip_path) as zfile:
zfile.extractall(images_path)
main.main(images_path, str(tmpdir.join('ocr_nl.db')))
stdout, _ = capsys.readouterr()
assert re.search(r'google was found with count', stdout)
评论列表
文章目录