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
c7663468
Commit
c7663468
authored
Nov 14, 2019
by
LE GAC Renaud
Browse files
Update to pass all harvest_tools tests.
parent
38150847
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
24 deletions
+22
-24
modules/harvest_tools/checkandfix.py
modules/harvest_tools/checkandfix.py
+1
-1
tests/harvest_tools/CheckAndFix/test_acl_cds1753190_fix.py
tests/harvest_tools/CheckAndFix/test_acl_cds1753190_fix.py
+8
-5
tests/harvest_tools/CheckAndFix/test_acl_cds1951625_fix.py
tests/harvest_tools/CheckAndFix/test_acl_cds1951625_fix.py
+12
-18
tests/harvest_tools/CheckAndFix/test_phd_cds1632177_fix.py
tests/harvest_tools/CheckAndFix/test_phd_cds1632177_fix.py
+1
-0
No files found.
modules/harvest_tools/checkandfix.py
View file @
c7663468
...
...
@@ -592,7 +592,7 @@ class CheckAndFix(object):
# Other: replace U. by University
else
:
university
=
current
.
T
(
UNIVERSITY
)
university
=
current
.
T
(
UNIVERSITY
,
lazy
=
False
)
if
"502"
in
record
and
"b"
in
record
[
"502"
]:
if
isinstance
(
record
[
"502"
][
"b"
],
str
):
...
...
tests/harvest_tools/CheckAndFix/test_acl_cds1753190_fix.py
View file @
c7663468
...
...
@@ -40,18 +40,21 @@ def test_paper_editor(record, recordfix):
def
test_paper_page
(
record
,
recordfix
):
assert
record
.
paper_pages
()
==
"75"
# 191119 fix in CDS
assert
record
.
paper_pages
()
==
"158"
assert
recordfix
.
paper_pages
()
==
"158"
def
test_paper_volume
(
record
,
recordfix
):
assert
record
.
paper_volume
()
==
""
assert
recordfix
.
paper_volume
()
==
"75"
# 191119 fix in CDS
assert
record
.
paper_volume
()
==
"C75"
assert
recordfix
.
paper_volume
()
==
"C75"
def
test_paper_reference
(
record
,
recordfix
):
assert
record
.
paper_reference
()
==
"Eur. Phys. J. C 2015 75"
assert
recordfix
.
paper_reference
()
==
"Eur. Phys. J. C 75 2015 158"
# 191119 fix in CDS
assert
record
.
paper_reference
()
==
"Eur. Phys. J. C C75 2015 158"
assert
recordfix
.
paper_reference
()
==
"Eur. Phys. J. C C75 2015 158"
def
test_paper_year
(
record
,
recordfix
):
...
...
tests/harvest_tools/CheckAndFix/test_acl_cds1951625_fix.py
View file @
c7663468
...
...
@@ -64,14 +64,6 @@ def test_find_authors_by_affiliation(recordfix):
svc
=
CheckAndFix
()
rex
=
svc
.
_get_reg_institute
()
references
=
set
([
"CPPM, Marseille"
,
"Centre de Physique des Particules de Marseille
\\
(CPPM
\\
)"
,
"Marseille, CPPM"
])
values
=
set
(
rex
.
split
(
"|"
))
assert
values
==
references
authors
=
recordfix
.
find_authors_by_affiliation
(
rex
)
assert
authors
.
split
(
', '
)
==
CPPM_AUTHORS
...
...
@@ -113,16 +105,18 @@ def test_my_affiliation(record):
value
=
svc
.
my_affiliation
(
rec
,
id_project
,
id_team
,
"F. Last"
)
assert
value
==
""
assert
svc
.
_my_authors
[
record
.
id
()]
==
[
'R. Le Gac'
,
'M. Perrin-Terrin'
,
'E. Aslanides'
,
'J. Cogan'
,
'J. Serrano'
,
'W. Kanso'
,
'S. Akar'
,
'O. Leroy'
,
'G. Mancinelli'
]
assert
set
(
svc
.
_my_authors
[
record
.
id
()])
==
{
"S. Akar"
,
"E. Aslanides"
,
"J. Cogan"
,
"W. Kanso"
,
"R. Le Gac"
,
"O. Leroy"
,
"G. Mancinelli"
,
"A. Mordà"
,
"M. Perrin-Terrin"
,
"J. Serrano"
}
def
test_my_authors
(
recordfix
):
assert
recordfix
.
my_authors
.
split
(
', '
)
==
CPPM_AUTHORS
...
...
tests/harvest_tools/CheckAndFix/test_phd_cds1632177_fix.py
View file @
c7663468
...
...
@@ -27,6 +27,7 @@ from invenio_tools import load_record
def
record
():
return
load_record
(
'cds.cern.ch'
,
1632177
)
@
pytest
.
fixture
(
scope
=
"module"
)
def
recordfix
(
record
):
rec
=
copy
.
deepcopy
(
record
)
...
...
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