From 7ebe32a290aa160c43671c21e968d1614a878f02 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Wed, 20 Jun 2018 19:55:53 -0700 Subject: importer tests and fixes --- python/tests/importer.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 python/tests/importer.py (limited to 'python/tests/importer.py') diff --git a/python/tests/importer.py b/python/tests/importer.py new file mode 100644 index 00000000..190acbed --- /dev/null +++ b/python/tests/importer.py @@ -0,0 +1,15 @@ + + +import pytest +from fatcat.importer_common import FatcatImporter + + +def test_issnl_mapping_lookup(): + with open('tests/files/ISSN-to-ISSN-L.snip.txt', 'r') as issn_file: + fi = FatcatImporter("http://localhost:9411/v0", issn_file) + + assert fi.issn2issnl('0000-0027') == '0002-0027' + assert fi.issn2issnl('0002-0027') == '0002-0027' + assert fi.issn2issnl('9999-0027') == None + + assert fi.lookup_issnl('9999-9999') == None -- cgit v1.2.3