aboutsummaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2018-09-10 19:37:36 -0700
committerBryan Newbold <bnewbold@robocracy.org>2018-09-10 19:37:36 -0700
commitdd0dbc45a0c0aad0819203431d374cbd93cce58f (patch)
treef9a8fb6e8eea82d54f561fb89472d16a4f287505 /python
parent1aa49b2c613178f17a2cb6e85a22f183a1c81947 (diff)
parent60b070103e80a83e062a57cefd0ba0a84fc3a4c0 (diff)
downloadfatcat-x-attic-cockroach.tar.gz
fatcat-x-attic-cockroach.zip
Merge branch 'master' into cockroachx-attic-cockroachcockroach
Manually resolve conflicts in: rust/migrations/2018-05-12-001226_init/up.sql
Diffstat (limited to 'python')
-rw-r--r--python/fatcat/importer_common.py2
-rw-r--r--python/tests/files/0000-0003-3953-765X.json1
-rw-r--r--python/tests/importer.py1
-rw-r--r--python/tests/orcid.py6
4 files changed, 9 insertions, 1 deletions
diff --git a/python/fatcat/importer_common.py b/python/fatcat/importer_common.py
index 0b02d175..74a57ac1 100644
--- a/python/fatcat/importer_common.py
+++ b/python/fatcat/importer_common.py
@@ -23,7 +23,7 @@ class FatcatImporter:
self._orcid_id_map = dict()
self._doi_id_map = dict()
self._issn_issnl_map = None
- self._orcid_regex = re.compile("^\\d{4}-\\d{4}-\\d{4}-\\d{4}$")
+ self._orcid_regex = re.compile("^\\d{4}-\\d{4}-\\d{4}-\\d{3}[\\dX]$")
if issn_map_file:
self.read_issn_map_file(issn_map_file)
diff --git a/python/tests/files/0000-0003-3953-765X.json b/python/tests/files/0000-0003-3953-765X.json
new file mode 100644
index 00000000..9699d1bf
--- /dev/null
+++ b/python/tests/files/0000-0003-3953-765X.json
@@ -0,0 +1 @@
+{"orcid-identifier":{"uri":"http://orcid.org/0000-0003-3953-765X","path":"0000-0003-3953-765X","host":"orcid.org"},"preferences":{"locale":"en"},"history":{"creation-method":"Member-referred","completion-date":null,"submission-date":{"value":1407501041999},"last-modified-date":{"value":1465949566770},"claimed":true,"source":null,"deactivation-date":null,"verified-email":true,"verified-primary-email":true},"person":{"last-modified-date":null,"name":{"created-date":{"value":1460755375159},"last-modified-date":{"value":1460755375159},"given-names":{"value":"Man-Hui"},"family-name":{"value":"Li"},"credit-name":null,"source":null,"visibility":"public","path":"0000-0003-3953-765X"},"other-names":{"last-modified-date":null,"other-name":null,"path":"/0000-0003-3953-765X/other-names"},"biography":{"created-date":{"value":1460755375161},"last-modified-date":{"value":1460755375161},"content":null,"visibility":"public","path":"/0000-0003-3953-765X/biography"},"researcher-urls":{"last-modified-date":null,"researcher-url":null,"path":"/0000-0003-3953-765X/researcher-urls"},"emails":{"last-modified-date":null,"email":null,"path":"/0000-0003-3953-765X/email"},"addresses":{"last-modified-date":null,"address":null,"path":"/0000-0003-3953-765X/address"},"keywords":{"last-modified-date":null,"keyword":null,"path":"/0000-0003-3953-765X/keywords"},"external-identifiers":{"last-modified-date":null,"external-identifier":null,"path":"/0000-0003-3953-765X/external-identifiers"},"path":"/0000-0003-3953-765X/person"},"activities-summary":{"last-modified-date":null,"educations":{"last-modified-date":null,"education-summary":null,"path":"/0000-0003-3953-765X/educations"},"employments":{"last-modified-date":null,"employment-summary":null,"path":"/0000-0003-3953-765X/employments"},"fundings":{"last-modified-date":null,"group":null,"path":"/0000-0003-3953-765X/fundings"},"peer-reviews":{"last-modified-date":null,"group":null,"path":"/0000-0003-3953-765X/peer-reviews"},"works":{"last-modified-date":null,"group":null,"path":"/0000-0003-3953-765X/works"},"path":"/0000-0003-3953-765X/activities"},"path":"/0000-0003-3953-765X"}
diff --git a/python/tests/importer.py b/python/tests/importer.py
index 4d49e794..22af37ed 100644
--- a/python/tests/importer.py
+++ b/python/tests/importer.py
@@ -29,6 +29,7 @@ def test_identifiers():
assert fi.is_doi("10.1234_56789") == False
assert fi.is_orcid("0000-0003-3118-6591") == True
+ assert fi.is_orcid("0000-0003-3953-765X") == 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
diff --git a/python/tests/orcid.py b/python/tests/orcid.py
index e07583ac..ae3d0d0b 100644
--- a/python/tests/orcid.py
+++ b/python/tests/orcid.py
@@ -21,6 +21,12 @@ def test_orcid_importer(orcid_importer):
with open('tests/files/0000-0001-8254-7103.json', 'r') as f:
orcid_importer.process_source(f)
+def test_orcid_importer_x(orcid_importer):
+ with open('tests/files/0000-0003-3953-765X.json', 'r') as f:
+ orcid_importer.process_source(f)
+ c = orcid_importer.api.lookup_creator(orcid="0000-0003-3953-765X")
+ assert c is not None
+
def test_orcid_dict_parse(orcid_importer):
with open('tests/files/0000-0001-8254-7103.json', 'r') as f:
raw = json.loads(f.readline())