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
0d3f1bb3
Commit
0d3f1bb3
authored
Aug 28, 2017
by
LE GAC Renaud
Browse files
Bug fix: affiliation in second position not found (ins1519593).
parent
43a528ee
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
4 deletions
+33
-4
modules/harvest_tools/checkandfix.py
modules/harvest_tools/checkandfix.py
+1
-1
tests/harvest_tools/CheckAndFix/test_acl_cds1951625_fix.py
tests/harvest_tools/CheckAndFix/test_acl_cds1951625_fix.py
+3
-3
tests/issues/test_acti.py
tests/issues/test_acti.py
+29
-0
No files found.
modules/harvest_tools/checkandfix.py
View file @
0d3f1bb3
...
@@ -117,7 +117,7 @@ class CheckAndFix(object):
...
@@ -117,7 +117,7 @@ class CheckAndFix(object):
iterselect
=
db
(
db
.
affiliation_keys
.
id
>
0
).
iterselect
()
iterselect
=
db
(
db
.
affiliation_keys
.
id
>
0
).
iterselect
()
reg_institute
=
\
reg_institute
=
\
u
"|"
.
join
(
imap
(
u
"|"
.
join
(
imap
(
lambda
row
:
u
"
^
%(key_u)s%(key_v)s"
%
row
,
iterselect
))
lambda
row
:
u
"%(key_u)s%(key_v)s"
%
row
,
iterselect
))
# protect special character
# protect special character
reg_institute
=
(
reg_institute
reg_institute
=
(
reg_institute
...
...
tests/harvest_tools/CheckAndFix/test_acl_cds1951625_fix.py
View file @
0d3f1bb3
...
@@ -66,9 +66,9 @@ def test_find_authors_by_affiliation(recordfix):
...
@@ -66,9 +66,9 @@ def test_find_authors_by_affiliation(recordfix):
rex
=
svc
.
_get_reg_institute
()
rex
=
svc
.
_get_reg_institute
()
references
=
set
([
references
=
set
([
"
^
CPPM, Marseille"
,
"CPPM, Marseille"
,
"
^
Centre de Physique des Particules de Marseille
\\
(CPPM
\\
)"
,
"Centre de Physique des Particules de Marseille
\\
(CPPM
\\
)"
,
"
^
Marseille, CPPM"
])
"Marseille, CPPM"
])
values
=
set
(
rex
.
split
(
"|"
))
values
=
set
(
rex
.
split
(
"|"
))
assert
values
==
references
assert
values
==
references
...
...
tests/issues/test_acti.py
0 → 100644
View file @
0d3f1bb3
# -*- coding: utf-8 -*-
"""test_acti
* collection of proceeding with issues
"""
import
pytest
from
gluon
import
current
from
harvest_tools.checkandfix
import
CheckAndFix
from
invenio_tools
import
load_record
@
pytest
.
fixture
(
scope
=
"module"
)
def
svc
():
return
CheckAndFix
()
def
test_acti_ins1519593
(
svc
):
"""
XML:
* IPN author not found with release 0.9.6.5.
The Correct affiliation is defined but in second position.
"""
recins
=
load_record
(
"inspirehep.net"
,
1519593
)
pattern
=
"Orsay, IPN|IPNO, Orsay"
current
.
app
.
reg_institute
=
pattern
assert
recins
.
find_authors_by_affiliation
(
pattern
)
==
"Scozzi, Federico"
\ No newline at end of file
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