diff options
author | Bryan Newbold <bnewbold@robocracy.org> | 2020-11-05 17:29:44 -0800 |
---|---|---|
committer | Bryan Newbold <bnewbold@robocracy.org> | 2020-11-05 17:29:44 -0800 |
commit | cad812bf78f7363e698139cd7b95d7434f8ae4bb (patch) | |
tree | 3896497c20ff0b257fe425cf56b33a3e79814aee /python/tests/import_ingest.py | |
parent | 8b6b1447cc37fb76865fd80377c55463e59db3b9 (diff) | |
download | fatcat-cad812bf78f7363e698139cd7b95d7434f8ae4bb.tar.gz fatcat-cad812bf78f7363e698139cd7b95d7434f8ae4bb.zip |
ingest: tests for basic XML ingest
Diffstat (limited to 'python/tests/import_ingest.py')
-rw-r--r-- | python/tests/import_ingest.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/python/tests/import_ingest.py b/python/tests/import_ingest.py index 05287af4..21552fb9 100644 --- a/python/tests/import_ingest.py +++ b/python/tests/import_ingest.py @@ -41,6 +41,23 @@ def test_ingest_importer(ingest_importer): assert counts['exists'] == 1 assert counts['skip'] == 1 +def test_ingest_importer_xml(ingest_importer): + last_index = ingest_importer.api.get_changelog(limit=1)[0].index + with open('tests/files/example_ingest_xml.json', 'r') as f: + ingest_importer.bezerk_mode = True + counts = JsonLinePusher(ingest_importer, f).run() + assert counts['insert'] == 1 + assert counts['exists'] == 0 + assert counts['skip'] == 0 + + # fetch most recent editgroup + change = ingest_importer.api.get_changelog_entry(index=last_index+1) + eg = change.editgroup + assert eg.description + assert "crawled from web" in eg.description.lower() + assert eg.extra['git_rev'] + assert "fatcat_tools.IngestFileResultImporter" in eg.extra['agent'] + def test_ingest_importer_stage(ingest_importer, api): """ Tests that ingest importer correctly handles release stage matching |