-
Notifications
You must be signed in to change notification settings - Fork 9
/
conftest.py
48 lines (37 loc) · 1.88 KB
/
conftest.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import pytest
from os.path import join
def read_file(tmp_path_factory, n):
data = tmp_path_factory.getbasetemp() / n
with open(join('test-files', n), 'rb') as fp:
data.write_bytes(fp.read())
return data
@pytest.fixture(scope='session')
def sim_hocr_file(tmp_path_factory):
return read_file(tmp_path_factory, 'sim_english-illustrated-magazine_1884-12_2_15_chocr.html.gz')
@pytest.fixture(scope='session')
def sim_hocr_lookup_file(tmp_path_factory):
return read_file(tmp_path_factory, 'sim_english-illustrated-magazine_1884-12_2_15_hocr_pageindex.json')
@pytest.fixture(scope='session')
def sim_hocr_searchtext_file(tmp_path_factory):
return read_file(tmp_path_factory, 'sim_english-illustrated-magazine_1884-12_2_15_hocr_searchtext.txt')
@pytest.fixture(scope='session')
def pdf_file(tmp_path_factory):
return read_file(tmp_path_factory, 'test_arlington_heights_daily_herald-19760903.pdf')
@pytest.fixture(scope='session')
def pdf_metadata_file(tmp_path_factory):
return read_file(tmp_path_factory, 'test_arlington_heights_daily_herald-19760903_pdfmeta.json')
@pytest.fixture(scope='session')
def pdf_chocr_file(tmp_path_factory):
return read_file(tmp_path_factory, 'test_arlington_heights_daily_herald-19760903_chocr.html')
@pytest.fixture(scope='session')
def sim_english_pagenumber_json_file(tmp_path_factory):
return read_file(tmp_path_factory, 'sim_english_pagenumbers.json')
@pytest.fixture(scope='session')
def abbyy_file(tmp_path_factory):
return read_file(tmp_path_factory, 'sim_english-illustrated-magazine_1884-12_2_15_abbyy')
@pytest.fixture(scope='session')
def abbyy_to_hocr_file(tmp_path_factory):
return read_file(tmp_path_factory, 'sim_english-abbyy-to-hocr-result.html')
@pytest.fixture(scope='session')
def sim_hocr_file_text(tmp_path_factory):
return read_file(tmp_path_factory, 'sim_english-illustrated-magazine_1884-12_2_15_chocr.txt')