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
b5d7b17b
Commit
b5d7b17b
authored
Sep 17, 2016
by
LE GAC Renaud
Browse files
Restore pytest.
parent
505cce24
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
14 additions
and
9 deletions
+14
-9
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
+4
-2
tests/harvest_tools/CheckAndFix/test_acti_cds1411352_fix.py
tests/harvest_tools/CheckAndFix/test_acti_cds1411352_fix.py
+1
-1
tests/harvest_tools/CheckAndFix/test_acti_ins1276938_fix.py
tests/harvest_tools/CheckAndFix/test_acti_ins1276938_fix.py
+1
-1
tests/harvest_tools/CheckAndFix/test_checkandfix_non_conformities.py
...st_tools/CheckAndFix/test_checkandfix_non_conformities.py
+1
-1
tests/harvest_tools/CheckAndFix/test_com_cds1550918_fix.py
tests/harvest_tools/CheckAndFix/test_com_cds1550918_fix.py
+1
-1
tests/harvest_tools/CheckAndFix/test_phd_cds2015250_fix.py
tests/harvest_tools/CheckAndFix/test_phd_cds2015250_fix.py
+4
-1
tests/invenio_tools/Record/test_record_non_conformities.py
tests/invenio_tools/Record/test_record_non_conformities.py
+1
-1
No files found.
modules/harvest_tools/checkandfix.py
View file @
b5d7b17b
...
...
@@ -586,7 +586,7 @@ class CheckAndFix(object):
db
=
self
.
db
is_cppm
=
db
(
db
.
affiliation_keys
.
key_u
.
conta
in
s
(
"CPPM"
)
).
count
()
>
0
is_cppm
=
self
.
_get_reg_institute
().
f
in
d
(
"CPPM"
)
!=
-
1
# CPPM: fix the name of Aix-Marseille university
if
is_cppm
:
...
...
tests/harvest_tools/CheckAndFix/test_acl_cds1951625_fix.py
View file @
b5d7b17b
...
...
@@ -59,8 +59,10 @@ def recordfix(record):
def
test_find_authors_by_affiliation
(
recordfix
):
rex
=
current
.
app
.
reg_institute
assert
rex
==
"Marseille, CPPM|CPPM, Marseille|Centre de Physique des Particules de Marseille (CPPM)"
svc
=
CheckAndFix
()
rex
=
svc
.
_get_reg_institute
()
assert
rex
==
"^CPPM, Marseille|^Centre de Physique des Particules de Marseille (CPPM)|^Marseille, CPPM"
authors
=
recordfix
.
find_authors_by_affiliation
(
rex
,
family_name_fr
)
assert
authors
.
split
(
', '
)
==
CPPM_AUTHORS
...
...
tests/harvest_tools/CheckAndFix/test_acti_cds1411352_fix.py
View file @
b5d7b17b
...
...
@@ -37,7 +37,7 @@ def recordfix(record):
svc
=
CheckAndFix
()
svc
.
authors
(
rec
)
svc
.
country
(
rec
)
svc
.
conference_date
(
rec
)
svc
.
conference_date
(
rec
,
"cds.cern.ch"
)
svc
.
format_authors
(
rec
,
format_author_fr
)
svc
.
format_editor
(
rec
)
svc
.
get_my_authors
(
rec
,
family_name_fr
)
...
...
tests/harvest_tools/CheckAndFix/test_acti_ins1276938_fix.py
View file @
b5d7b17b
...
...
@@ -42,7 +42,7 @@ def recordfix(record):
svc
=
CheckAndFix
()
svc
.
authors
(
rec
)
svc
.
country
(
rec
)
svc
.
conference_date
(
rec
)
svc
.
conference_date
(
rec
,
"inspirehep.net"
)
svc
.
format_authors
(
rec
,
format_author_fr
)
svc
.
format_editor
(
rec
)
svc
.
submitted
(
rec
)
...
...
tests/harvest_tools/CheckAndFix/test_checkandfix_non_conformities.py
View file @
b5d7b17b
...
...
@@ -16,6 +16,6 @@ def test_protection_format_authors():
authors
=
record
[
u
"700"
]
assert
len
(
authors
)
==
139
assert
authors
[
128
][
"a"
]
==
u
"J. Z
un
iga"
assert
authors
[
128
][
"a"
]
==
u
"J. Z
úñ
iga"
tests/harvest_tools/CheckAndFix/test_com_cds1550918_fix.py
View file @
b5d7b17b
...
...
@@ -32,7 +32,7 @@ def recordfix(record):
svc
=
CheckAndFix
()
svc
.
authors
(
rec
)
svc
.
country
(
rec
)
svc
.
conference_date
(
rec
)
svc
.
conference_date
(
rec
,
"cds.cern.ch"
)
svc
.
format_authors
(
rec
,
format_author_fr
)
svc
.
format_editor
(
rec
)
svc
.
submitted
(
rec
)
...
...
tests/harvest_tools/CheckAndFix/test_phd_cds2015250_fix.py
View file @
b5d7b17b
...
...
@@ -16,9 +16,12 @@ from invenio_tools import load_record
def
test_these_universities
():
record
=
load_record
(
'cds.cern.ch'
,
2015250
)
current
.
app
.
inspirehep_institute_id
=
9999
svc
=
CheckAndFix
()
svc
.
_get_reg_institute
()
current
.
app
.
reg_institute
=
"dumy value"
svc
.
format_universities
(
record
)
assert
record
.
these_universities
()
==
[
u
"Milan Bicocca Université"
]
tests/invenio_tools/Record/test_record_non_conformities.py
View file @
b5d7b17b
...
...
@@ -13,7 +13,7 @@ def test_protection_authors_as_list():
record
=
load_record
(
'inspirehep.net'
,
1386663
)
authors
=
record
.
authors_as_list
()
assert
len
(
authors
)
==
140
assert
authors
[
129
]
==
u
"Z
un
iga, J."
assert
authors
[
129
]
==
u
"Z
úñ
iga, J."
def
test_protection_find_authors_by_affiliation
():
...
...
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