aboutsummaryrefslogtreecommitdiffstats
path: root/python/tests/transform_tests.py
blob: 52a9965acc3c34e47191acbee7f43754738b0e4c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

import json
import pytest
from fatcat_tools.importers.crossref import FatcatCrossrefImporter
from fatcat_tools.transforms import *

from import_crossref import crossref_importer

def test_elastic_convert(crossref_importer):
    with open('tests/files/crossref-works.single.json', 'r') as f:
        # not a single line
        raw = json.loads(f.read())
        (r, c) = crossref_importer.parse_crossref_dict(raw)
    r.state = 'active'
    release_elastic_dict(r)