summaryrefslogtreecommitdiffstats
path: root/python/tests/release_model.py
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2018-11-02 13:59:24 -0700
committerBryan Newbold <bnewbold@robocracy.org>2018-11-02 13:59:24 -0700
commitd70abdd82955feba4eecdda24ff6d95f703e0598 (patch)
tree541549eea3d085aca0f62ea6aa5124e0f509b9b2 /python/tests/release_model.py
parenta21f425b793cae9ce70f8327eae9702e62bc4329 (diff)
downloadfatcat-d70abdd82955feba4eecdda24ff6d95f703e0598.tar.gz
fatcat-d70abdd82955feba4eecdda24ff6d95f703e0598.zip
FatcatRelease: start wrapping entities with extra methods
Diffstat (limited to 'python/tests/release_model.py')
-rw-r--r--python/tests/release_model.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/python/tests/release_model.py b/python/tests/release_model.py
new file mode 100644
index 00000000..4b9dddba
--- /dev/null
+++ b/python/tests/release_model.py
@@ -0,0 +1,15 @@
+
+import json
+import pytest
+from fatcat.crossref_importer import FatcatCrossrefImporter
+from fatcat.release_model import FatcatRelease
+
+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'
+ r.to_elastic_dict()