blob: 37c6109668c3e404a32e685e5731c669aeccf590 (
plain)
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
|
import pytest
from chocula import *
@pytest.fixture
def config():
config = ChoculaConfig.from_file(sources_dir="tests/files/")
return config
@pytest.fixture
def issn_db():
return IssnDatabase(issn_issnl_file_path="tests/files/ISSN-to-ISSN-L.txt")
@pytest.fixture
def database(issn_db):
db = ChoculaDatabase(db_file=":memory:", issn_db=issn_db)
db.init_db()
return db
def test_all(config, database):
for cls in (CrossrefLoader, DoajLoader, EntrezLoader, EzbLoader,
GoldOALoader, NorwegianLoader, OpenAPCLoader, RoadLoader,
SherpaRomeoLoader, SzczepanskiLoader, WikidataLoader):
loader = cls(config)
counts = loader.index_file(database)
assert counts['total'] >= 20
assert counts['inserted'] > 5
|