aboutsummaryrefslogtreecommitdiffstats
path: root/python/tests/transform_elasticsearch.py
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2021-11-02 15:24:40 -0700
committerBryan Newbold <bnewbold@robocracy.org>2021-11-02 17:02:50 -0700
commit675ecb96fe0e51f169c2d01683f02205ef327825 (patch)
tree19be01afe2ddb0791368a1b9b5223deb3cba6d19 /python/tests/transform_elasticsearch.py
parente148fce040b874c7dd397cb22118a3c03b7f02d4 (diff)
downloadfatcat-675ecb96fe0e51f169c2d01683f02205ef327825.tar.gz
fatcat-675ecb96fe0e51f169c2d01683f02205ef327825.zip
cleanup imports after fatcat_tools.transforms change
Diffstat (limited to 'python/tests/transform_elasticsearch.py')
-rw-r--r--python/tests/transform_elasticsearch.py31
1 files changed, 22 insertions, 9 deletions
diff --git a/python/tests/transform_elasticsearch.py b/python/tests/transform_elasticsearch.py
index ba2b7ea2..b9011892 100644
--- a/python/tests/transform_elasticsearch.py
+++ b/python/tests/transform_elasticsearch.py
@@ -1,13 +1,26 @@
-
-import json
import datetime
+import json
-from fatcat_tools import *
-from fatcat_openapi_client import *
-from import_journal_metadata import journal_metadata_importer
+from fatcat_openapi_client import (
+ ChangelogEntry,
+ ContainerEntity,
+ FileEntity,
+ FileUrl,
+ ReleaseEntity,
+ ReleaseExtIds,
+ ReleaseRef,
+)
+from fixtures import api
from import_crossref import crossref_importer
-from import_matched import matched_importer
-from fixtures import *
+from import_journal_metadata import journal_metadata_importer
+
+from fatcat_tools.transforms import (
+ changelog_to_elasticsearch,
+ container_to_elasticsearch,
+ entity_from_json,
+ file_to_elasticsearch,
+ release_to_elasticsearch,
+)
def test_basic_elasticsearch_convert(crossref_importer):
@@ -190,7 +203,7 @@ def test_elasticsearch_container_transform(journal_metadata_importer):
assert es['any_kbart'] == True
-def test_elasticsearch_file_transform(matched_importer):
+def test_elasticsearch_file_transform():
f = entity_from_json(open('./tests/files/file_bcah4zp5tvdhjl5bqci2c2lgfa.json', 'r').read(), FileEntity)
f.state = 'active'
@@ -210,7 +223,7 @@ def test_elasticsearch_file_transform(matched_importer):
# old regression
assert not '.archive.org' in (es['hosts'] + es['domains'])
-def test_elasticsearch_changelog_transform(matched_importer):
+def test_elasticsearch_changelog_transform():
ce = entity_from_json(open('./tests/files/changelog_3469683.json', 'r').read(), ChangelogEntry)
es = changelog_to_elasticsearch(ce)