Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
limbra
limbra
Commits
98a1af1f
Commit
98a1af1f
authored
Jan 11, 2021
by
LE GAC Renaud
Browse files
Update checkAndFix.temporary_record
parent
1a93c0f4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
5 deletions
+11
-5
modules/harvest_tools/checkandfix.py
modules/harvest_tools/checkandfix.py
+10
-4
tests/basis/test_11_CheckAndFix_base.py
tests/basis/test_11_CheckAndFix_base.py
+1
-1
No files found.
modules/harvest_tools/checkandfix.py
View file @
98a1af1f
...
...
@@ -76,6 +76,7 @@ REG_WELL_FORMED_CONF_DATES_2 = \
re
.
compile
(
"\d{1,2} [A-Z][a-z]{2} - \d{1,2} [A-Z][a-z]{2} \d{4}"
)
T6
=
" "
*
6
TMP_REC
=
"*Temporary record*"
UNIVERSITY
=
"University"
...
...
@@ -1004,9 +1005,14 @@ class CheckAndFix(object):
# Can be find by using the XML syntax:
# http://inspirehep.net/search?500__a="*Temporary record*"
#
# or the corresponding JSON field
:
# or the corresponding JSON field
(old.inspirehep.net)
# http://inspirehep.net/comment="*Temporary record*"
#
if
"comment"
in
record
:
if
record
[
"comment"
]
==
"*Temporary record*"
:
raise
CheckException
(
MSG_TEMPORARY_RECORD
)
# for the new inspirehep API curated is False
#
is_temporary
=
\
(
"comment"
in
record
and
record
[
"comment"
]
==
TMP_REC
)
\
or
(
"curated"
in
record
and
record
[
"curated"
]
is
False
)
if
is_temporary
:
raise
CheckException
(
MSG_TEMPORARY_RECORD
)
tests/basis/test_11_CheckAndFix_base.py
View file @
98a1af1f
...
...
@@ -67,7 +67,7 @@ def test_temporary_record_cds_11012(svc, reccds):
# try with the oldest one to avoid issue with missing information, etc.
with
pytest
.
raises
(
CheckException
):
recins
=
load_record
(
"inspirehep.net"
,
li
[
-
1
])
recins
=
load_record
(
"inspirehep.net"
,
li
[
-
1
]
,
shelf
=
"literature"
)
svc
.
temporary_record
(
recins
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment