Files
owocr/tests/test_ocr.py
Maciej Budyś 6309289958 add tests (#18)
* add tests

* add sentencepiece dependency
2022-11-03 21:01:36 +01:00

17 lines
408 B
Python

import json
from pathlib import Path
from manga_ocr import MangaOcr
TEST_DATA_ROOT = Path(__file__).parent / 'data'
def test_ocr():
mocr = MangaOcr()
expected_results = json.loads((TEST_DATA_ROOT / 'expected_results.json').read_text(encoding='utf-8'))
for item in expected_results:
result = mocr(TEST_DATA_ROOT / 'images' / item['filename'])
assert result == item['result']