summaryrefslogtreecommitdiffstats
path: root/python/tests/transform_tests.py
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2018-11-12 23:37:28 -0800
committerBryan Newbold <bnewbold@robocracy.org>2018-11-12 23:37:28 -0800
commit7ebda2e051b51e49544ab75673b19ec5f27d9d45 (patch)
tree671fd995b2fdb0b9ec69cfcb0e7771f43c13d32d /python/tests/transform_tests.py
parent889606ffac5096610e6123134cb89423c15ef464 (diff)
downloadfatcat-7ebda2e051b51e49544ab75673b19ec5f27d9d45.tar.gz
fatcat-7ebda2e051b51e49544ab75673b19ec5f27d9d45.zip
more python module refactoring
Diffstat (limited to 'python/tests/transform_tests.py')
-rw-r--r--python/tests/transform_tests.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/python/tests/transform_tests.py b/python/tests/transform_tests.py
new file mode 100644
index 00000000..669c2526
--- /dev/null
+++ b/python/tests/transform_tests.py
@@ -0,0 +1,15 @@
+
+import json
+import pytest
+from fatcat_tools.crossref_importer import FatcatCrossrefImporter
+from fatcat_tools.transforms 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)