summaryrefslogtreecommitdiffstats
path: root/python/tests/import_pubmed.py
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2019-12-23 14:00:59 -0800
committerBryan Newbold <bnewbold@robocracy.org>2019-12-23 14:00:59 -0800
commit4c2ca53303a949c00707e0c552489930f059a54a (patch)
treed3d59050e48efef6be5903f8e299d64743fc8c7b /python/tests/import_pubmed.py
parent052907bf8af22a2638554b719410b10ac1a8f9b6 (diff)
downloadfatcat-4c2ca53303a949c00707e0c552489930f059a54a.tar.gz
fatcat-4c2ca53303a949c00707e0c552489930f059a54a.zip
add regression test for medlinedate -> year parsing
Diffstat (limited to 'python/tests/import_pubmed.py')
-rw-r--r--python/tests/import_pubmed.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/python/tests/import_pubmed.py b/python/tests/import_pubmed.py
index 0d551d02..49609f75 100644
--- a/python/tests/import_pubmed.py
+++ b/python/tests/import_pubmed.py
@@ -119,3 +119,10 @@ def test_pubmed_xml_parse(pubmed_importer):
assert r2.refs[0].extra['unstructured'] == "Microbiology. 2009 Jun;155(Pt 6):1840-6"
assert r2.refs[0].extra['pmid'] == "19383690"
+def test_pubmed_xml_dates(pubmed_importer):
+ with open('tests/files/pubmed_31393839.xml', 'r') as f:
+ soup = BeautifulSoup(f, "xml")
+ r1 = pubmed_importer.parse_record(soup.find_all("PubmedArticle")[0])
+
+ assert r1.release_year == 2019
+