diff options
author | Bryan Newbold <bnewbold@robocracy.org> | 2019-04-18 16:49:49 -0700 |
---|---|---|
committer | Bryan Newbold <bnewbold@robocracy.org> | 2019-04-18 16:50:01 -0700 |
commit | 11dfac5f8f9ced9b56cf277d0e3adeccc572b251 (patch) | |
tree | fcc97e660b5e46b463a1295d8abbed2bb858bf03 | |
parent | a14d851ad230b3adb569ec6ca112cd4d9e638b2c (diff) | |
download | fatcat-11dfac5f8f9ced9b56cf277d0e3adeccc572b251.tar.gz fatcat-11dfac5f8f9ced9b56cf277d0e3adeccc572b251.zip |
fix arabesque importer crawl_id None bug
-rw-r--r-- | python/fatcat_tools/importers/arabesque.py | 2 | ||||
-rw-r--r-- | python/tests/import_arabesque.py | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/python/fatcat_tools/importers/arabesque.py b/python/fatcat_tools/importers/arabesque.py index c4850592..cdb8c7ad 100644 --- a/python/fatcat_tools/importers/arabesque.py +++ b/python/fatcat_tools/importers/arabesque.py @@ -57,7 +57,7 @@ class ArabesqueMatchImporter(EntityImporter): eg_extra = kwargs.get('editgroup_extra', dict()) eg_extra['agent'] = eg_extra.get('agent', 'fatcat_tools.ArabesqueMatchImporter') if kwargs.get('crawl_id'): - eg_extra['crawl_id'] = eg_extra.get('crawl_id') + eg_extra['crawl_id'] = kwargs.get('crawl_id') super().__init__(api, editgroup_description=eg_desc, editgroup_extra=eg_extra, diff --git a/python/tests/import_arabesque.py b/python/tests/import_arabesque.py index 9d74f96c..9483eb45 100644 --- a/python/tests/import_arabesque.py +++ b/python/tests/import_arabesque.py @@ -7,7 +7,7 @@ from fixtures import api @pytest.fixture(scope="function") def arabesque_importer(api): - yield ArabesqueMatchImporter(api, extid_type="doi") + yield ArabesqueMatchImporter(api, extid_type="doi", crawl_id="DUMMY123") # TODO: use API to check that entities actually created... def test_arabesque_importer_basic(arabesque_importer): @@ -31,6 +31,7 @@ def test_arabesque_importer(arabesque_importer): assert eg.description assert "identifier/url seedlist" in eg.description.lower() assert eg.extra['git_rev'] + assert eg.extra['crawl_id'] == "DUMMY123" assert "fatcat_tools.ArabesqueMatchImporter" in eg.extra['agent'] # re-insert; should skip |