aboutsummaryrefslogtreecommitdiffstats
path: root/python/tests/importer.py
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2018-09-09 10:10:42 -0700
committerBryan Newbold <bnewbold@robocracy.org>2018-09-09 10:10:42 -0700
commitb15eff77fdb7974ce2bf3c2e44c8edc354f9f452 (patch)
tree5bccb9ff2633eb35dc00babc0b2dd1842f02e49b /python/tests/importer.py
parent419bddcb0377e82e7177356350d35bf84b3e80d8 (diff)
parenta29beab0683d77086cc1b431779d0540dc5a9b49 (diff)
downloadfatcat-b15eff77fdb7974ce2bf3c2e44c8edc354f9f452.tar.gz
fatcat-b15eff77fdb7974ce2bf3c2e44c8edc354f9f452.zip
Merge branch 'http-verbs' into cockroach
Manually merged conflicts: rust/migrations/2018-05-12-001226_init/up.sql rust/src/api_server.rs rust/src/database_schema.rs
Diffstat (limited to 'python/tests/importer.py')
-rw-r--r--python/tests/importer.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/python/tests/importer.py b/python/tests/importer.py
index 190acbed..4d49e794 100644
--- a/python/tests/importer.py
+++ b/python/tests/importer.py
@@ -13,3 +13,23 @@ def test_issnl_mapping_lookup():
assert fi.issn2issnl('9999-0027') == None
assert fi.lookup_issnl('9999-9999') == None
+
+def test_identifiers():
+
+ with open('tests/files/ISSN-to-ISSN-L.snip.txt', 'r') as issn_file:
+ fi = FatcatImporter("http://localhost:9411/v0", issn_file)
+
+ assert fi.is_issnl("1234-5678") == True
+ assert fi.is_issnl("1234-5678.") == False
+ assert fi.is_issnl("12345678") == False
+ assert fi.is_issnl("1-2345678") == False
+
+ assert fi.is_doi("10.1234/56789") == True
+ assert fi.is_doi("101234/56789") == False
+ assert fi.is_doi("10.1234_56789") == False
+
+ assert fi.is_orcid("0000-0003-3118-6591") == True
+ assert fi.is_orcid("0000-00x3-3118-659") == False
+ assert fi.is_orcid("0000-00033118-659") == False
+ assert fi.is_orcid("0000-0003-3118-659.") == False
+