diff options
author | Bryan Newbold <bnewbold@robocracy.org> | 2018-11-12 23:13:22 -0800 |
---|---|---|
committer | Bryan Newbold <bnewbold@robocracy.org> | 2018-11-12 23:13:22 -0800 |
commit | 055c464deea8cdaccf3ed384995d4409b0f51409 (patch) | |
tree | 582e3d62d192d51fafed0c5e3321fd21a3a42d34 /python/tests | |
parent | 6828313ecf2fea06e500f447f3abb92e5651c1fa (diff) | |
parent | 942f23257bcf1059a2502a3b019ce5af1bde7de5 (diff) | |
download | fatcat-055c464deea8cdaccf3ed384995d4409b0f51409.tar.gz fatcat-055c464deea8cdaccf3ed384995d4409b0f51409.zip |
Merge branch 'kafka'
Diffstat (limited to 'python/tests')
-rw-r--r-- | python/tests/entity_helpers.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/python/tests/entity_helpers.py b/python/tests/entity_helpers.py new file mode 100644 index 00000000..dd6fa00a --- /dev/null +++ b/python/tests/entity_helpers.py @@ -0,0 +1,15 @@ + +import json +import pytest +from fatcat.crossref_importer import FatcatCrossrefImporter +from fatcat.entity_helpers import * + +from 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) |