aboutsummaryrefslogtreecommitdiffstats
path: root/python/tests/harvest_pubmed.py
diff options
context:
space:
mode:
authorMartin Czygan <martin.czygan@gmail.com>2020-03-10 12:51:11 +0100
committerMartin Czygan <martin.czygan@gmail.com>2020-03-10 12:51:11 +0100
commitdb8892f2d960379525a4182b884c1d51c0c70186 (patch)
tree538e9a907425bc718fe3b0cf8e21b06a366525ea /python/tests/harvest_pubmed.py
parent34a18cd1821d09ac0beee8959407ec51cf397337 (diff)
downloadfatcat-db8892f2d960379525a4182b884c1d51c0c70186.tar.gz
fatcat-db8892f2d960379525a4182b884c1d51c0c70186.zip
pubmed: move mapping generation out of fetch_date
* fetch_date will fail on missing mapping * adjust tests (test will require access to pubmed ftp)
Diffstat (limited to 'python/tests/harvest_pubmed.py')
-rw-r--r--python/tests/harvest_pubmed.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/python/tests/harvest_pubmed.py b/python/tests/harvest_pubmed.py
index 71832722..f8db46b6 100644
--- a/python/tests/harvest_pubmed.py
+++ b/python/tests/harvest_pubmed.py
@@ -9,6 +9,7 @@ import os
import pytest
from fatcat_tools.harvest import *
+from fatcat_tools.harvest.pubmed import generate_date_file_map
def test_pubmed_harvest_date(mocker):
@@ -40,6 +41,7 @@ def test_pubmed_harvest_date(mocker):
)
harvester.producer = mocker.Mock()
+ harvester.date_file_map = generate_date_file_map()
# Since we mock out the FTP fetch, the concrete date does not matter here.
harvester.fetch_date(datetime.datetime.strptime(test_date, '%Y-%m-%d'))