summaryrefslogtreecommitdiffstats
path: root/python/tests/import_ingest.py
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2020-11-05 17:19:37 -0800
committerBryan Newbold <bnewbold@robocracy.org>2020-11-05 17:19:37 -0800
commit8b6b1447cc37fb76865fd80377c55463e59db3b9 (patch)
tree42b2f26171db65e10d786f0bc45cccac79ae8b07 /python/tests/import_ingest.py
parent5afde4690a4653db53fe4962af5da3eb9188d9a2 (diff)
downloadfatcat-8b6b1447cc37fb76865fd80377c55463e59db3b9.tar.gz
fatcat-8b6b1447cc37fb76865fd80377c55463e59db3b9.zip
ingest: basic checks for ingest_type
Diffstat (limited to 'python/tests/import_ingest.py')
-rw-r--r--python/tests/import_ingest.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/python/tests/import_ingest.py b/python/tests/import_ingest.py
index 4a46232a..05287af4 100644
--- a/python/tests/import_ingest.py
+++ b/python/tests/import_ingest.py
@@ -94,6 +94,12 @@ def test_ingest_dict_parse(ingest_importer):
def test_ingest_dict_parse_old(ingest_importer):
with open('tests/files/example_ingest.old.json', 'r') as f:
raw = json.loads(f.readline())
+
+ # ancient ingest requests had no type; skip them
+ f = ingest_importer.parse_record(raw)
+ assert f == None
+ raw['request']['ingest_type'] = 'pdf'
+
f = ingest_importer.parse_record(raw)
assert f.sha1 == "00242a192acc258bdfdb151943419437f440c313"
assert f.md5 == "f4de91152c7ab9fdc2a128f962faebff"