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
Docker-in-Docker (DinD) capabilities of public runners deactivated.
More info
Open sidebar
limbra
limbra
Commits
f33fc97b
Commit
f33fc97b
authored
Nov 13, 2019
by
LE GAC Renaud
Browse files
Apply 2to3 converter to tests.
parent
99ea7f72
Changes
35
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
22 additions
and
54 deletions
+22
-54
tests/harvest_tools/Automaton/test_all_harvesters.py
tests/harvest_tools/Automaton/test_all_harvesters.py
+0
-1
tests/harvest_tools/Automaton/test_reject_on_oai.py
tests/harvest_tools/Automaton/test_reject_on_oai.py
+1
-2
tests/harvest_tools/Automaton/test_single_harvester.py
tests/harvest_tools/Automaton/test_single_harvester.py
+0
-1
tests/harvest_tools/CheckAndFix/test_acl_cds1753190_fix.py
tests/harvest_tools/CheckAndFix/test_acl_cds1753190_fix.py
+0
-1
tests/harvest_tools/CheckAndFix/test_acl_cds1951625_fix.py
tests/harvest_tools/CheckAndFix/test_acl_cds1951625_fix.py
+12
-13
tests/harvest_tools/CheckAndFix/test_acl_ins1278588_fix.py
tests/harvest_tools/CheckAndFix/test_acl_ins1278588_fix.py
+0
-1
tests/harvest_tools/CheckAndFix/test_acti_cds1411352_fix.py
tests/harvest_tools/CheckAndFix/test_acti_cds1411352_fix.py
+0
-1
tests/harvest_tools/CheckAndFix/test_acti_ins1276938_fix.py
tests/harvest_tools/CheckAndFix/test_acti_ins1276938_fix.py
+0
-1
tests/harvest_tools/CheckAndFix/test_checkandfix_non_conformities.py
...st_tools/CheckAndFix/test_checkandfix_non_conformities.py
+4
-5
tests/harvest_tools/CheckAndFix/test_com_cds1550918_fix.py
tests/harvest_tools/CheckAndFix/test_com_cds1550918_fix.py
+0
-1
tests/harvest_tools/CheckAndFix/test_phd_cds1394605_fix.py
tests/harvest_tools/CheckAndFix/test_phd_cds1394605_fix.py
+1
-2
tests/harvest_tools/CheckAndFix/test_phd_cds1632177_fix.py
tests/harvest_tools/CheckAndFix/test_phd_cds1632177_fix.py
+0
-1
tests/harvest_tools/CheckAndFix/test_phd_cds1642541_fix.py
tests/harvest_tools/CheckAndFix/test_phd_cds1642541_fix.py
+1
-2
tests/harvest_tools/CheckAndFix/test_phd_cds2015250_fix.py
tests/harvest_tools/CheckAndFix/test_phd_cds2015250_fix.py
+1
-5
tests/harvest_tools/CheckAndFix/test_recovery_mechanism.py
tests/harvest_tools/CheckAndFix/test_recovery_mechanism.py
+0
-4
tests/harvest_tools/test_harvest_tools_functions.py
tests/harvest_tools/test_harvest_tools_functions.py
+2
-6
tests/invenio_tools/InvenioStore/test_invenio_cds1951625.py
tests/invenio_tools/InvenioStore/test_invenio_cds1951625.py
+0
-1
tests/invenio_tools/InvenioStore/test_inveniostore.py
tests/invenio_tools/InvenioStore/test_inveniostore.py
+0
-1
tests/invenio_tools/Marc12/test_marc.py
tests/invenio_tools/Marc12/test_marc.py
+0
-4
tests/invenio_tools/Record/test_acl_cds1753190.py
tests/invenio_tools/Record/test_acl_cds1753190.py
+0
-1
No files found.
tests/harvest_tools/Automaton/test_all_harvesters.py
View file @
f33fc97b
# -*- coding: utf-8 -*-
"""test_all_harvester
"""
...
...
tests/harvest_tools/Automaton/test_reject_on_oai.py
View file @
f33fc97b
# -*- coding: utf-8 -*-
"""test_reject_on_oai
"""
...
...
@@ -18,7 +17,7 @@ def test_is_record_in_db():
row
=
db
(
query
).
select
().
first
()
assert
row
.
origin
==
"http://cds.cern.ch/record/1389907, http://inspirehep.net/record/939619"
atm
=
Automaton
(
db
,
7
,
8
,
u
"articles"
,
2
)
atm
=
Automaton
(
db
,
7
,
8
,
"articles"
,
2
)
rec_id_1
=
atm
.
_is_record_in_db
(
"Luminosity measurement"
,
host
=
"cds.cern.ch"
,
...
...
tests/harvest_tools/Automaton/test_single_harvester.py
View file @
f33fc97b
# -*- coding: utf-8 -*-
"""test_single_harvester
"""
...
...
tests/harvest_tools/CheckAndFix/test_acl_cds1753190_fix.py
View file @
f33fc97b
# -*- coding: utf-8 -*-
"""ARTICLE
http://cds.cern.ch/record/1753190.
...
...
tests/harvest_tools/CheckAndFix/test_acl_cds1951625_fix.py
View file @
f33fc97b
# -*- coding: utf-8 -*-
"""ARTICLE
http://cds.cern.ch/record/1951625.
...
...
@@ -28,17 +27,17 @@ from invenio_tools import load_record
from
plugin_dbui
import
get_id
CPPM_AUTHORS
=
[
u
"S. Akar"
,
u
"E. Aslanides"
,
u
"J. Cogan"
,
u
"W. Kanso"
,
u
"R. Le Gac"
,
u
"O. Leroy"
,
u
"G. Mancinelli"
,
u
"A. Mordà"
,
u
"M. Perrin-Terrin"
,
u
"J. Serrano"
,
u
"A. Tsaregorodtsev"
]
CPPM_AUTHORS
=
[
"S. Akar"
,
"E. Aslanides"
,
"J. Cogan"
,
"W. Kanso"
,
"R. Le Gac"
,
"O. Leroy"
,
"G. Mancinelli"
,
"A. Mordà"
,
"M. Perrin-Terrin"
,
"J. Serrano"
,
"A. Tsaregorodtsev"
]
@
pytest
.
fixture
(
scope
=
"module"
)
...
...
@@ -109,7 +108,7 @@ def test_my_affiliation(record):
# delete the affiliation
# and check that the affiliation is performed via the rescue list
rec
[
u
"700"
].
u
=
""
rec
[
"700"
].
u
=
""
value
=
svc
.
my_affiliation
(
rec
,
id_project
,
id_team
,
"F. Last"
)
assert
value
==
""
...
...
tests/harvest_tools/CheckAndFix/test_acl_ins1278588_fix.py
View file @
f33fc97b
# -*- coding: utf-8 -*-
"""ARTICLE
http://inspirehep.net/record/1278588.
...
...
tests/harvest_tools/CheckAndFix/test_acti_cds1411352_fix.py
View file @
f33fc97b
# -*- coding: utf-8 -*-
"""PROCEEDING
http://cds.cern.ch/record/1411352
...
...
tests/harvest_tools/CheckAndFix/test_acti_ins1276938_fix.py
View file @
f33fc97b
# -*- coding: utf-8 -*-
"""PROCEEDING
http://inspirehep.net/record/1276938
...
...
tests/harvest_tools/CheckAndFix/test_checkandfix_non_conformities.py
View file @
f33fc97b
# -*- coding: utf-8 -*-
"""CheckAndFix non conformities
"""
...
...
@@ -13,10 +12,10 @@ def test_protection_format_authors():
svc
=
CheckAndFix
()
svc
.
format_authors
(
record
,
"F. Last"
)
authors
=
record
[
u
"700"
]
authors
=
record
[
"700"
]
assert
len
(
authors
)
==
140
assert
authors
.
iloc
[
0
].
fmt_name
==
u
"S. Adrián-Martínez"
assert
authors
.
iloc
[
128
].
fmt_name
==
u
"J. D. Zornoza"
assert
authors
.
iloc
[
139
].
fmt_name
==
u
"D. M. Coward"
assert
authors
.
iloc
[
0
].
fmt_name
==
"S. Adrián-Martínez"
assert
authors
.
iloc
[
128
].
fmt_name
==
"J. D. Zornoza"
assert
authors
.
iloc
[
139
].
fmt_name
==
"D. M. Coward"
tests/harvest_tools/CheckAndFix/test_com_cds1550918_fix.py
View file @
f33fc97b
# -*- coding: utf-8 -*-
"""TALK
http://cds.cern.ch/record/1550918
...
...
tests/harvest_tools/CheckAndFix/test_phd_cds1394605_fix.py
View file @
f33fc97b
# -*- coding: utf-8 -*-
"""PHD
http://cds.cern.ch/record/1394605
...
...
@@ -63,7 +62,7 @@ def test_submitted(record):
def
test_these_universities
(
record
):
assert
record
.
these_universities
()
==
[
u
"Université de la Méditerrannée Aix-Marseille II"
]
assert
record
.
these_universities
()
==
[
"Université de la Méditerrannée Aix-Marseille II"
]
def
test_year
(
record
):
...
...
tests/harvest_tools/CheckAndFix/test_phd_cds1632177_fix.py
View file @
f33fc97b
# -*- coding: utf-8 -*-
"""PHD
http://cds.cern.ch/record/1632177
...
...
tests/harvest_tools/CheckAndFix/test_phd_cds1642541_fix.py
View file @
f33fc97b
# -*- coding: utf-8 -*-
"""PHD
http://cds.cern.ch/record/1642541
...
...
@@ -63,7 +62,7 @@ def test_submitted(record):
def
test_these_universities
(
record
):
assert
record
.
these_universities
()
==
[
u
"Aix Marseille Université"
]
assert
record
.
these_universities
()
==
[
"Aix Marseille Université"
]
def
test_year
(
record
):
...
...
tests/harvest_tools/CheckAndFix/test_phd_cds2015250_fix.py
View file @
f33fc97b
# -*- coding: utf-8 -*-
"""PHD
http://cds.cern.ch/record/2015250
...
...
@@ -6,8 +5,6 @@
"""
import
pytest
from
gluon
import
current
from
harvest_tools
import
CheckAndFix
from
invenio_tools
import
load_record
...
...
@@ -16,7 +13,6 @@ from invenio_tools import load_record
def
test_these_universities
():
record
=
load_record
(
'cds.cern.ch'
,
2015250
)
svc
=
CheckAndFix
()
svc
.
_get_reg_institute
()
...
...
@@ -24,4 +20,4 @@ def test_these_universities():
svc
.
format_universities
(
record
)
assert
record
.
these_universities
()
==
[
u
"Milan Bicocca Université"
]
assert
record
.
these_universities
()
==
[
"Milan Bicocca Université"
]
tests/harvest_tools/CheckAndFix/test_recovery_mechanism.py
View file @
f33fc97b
# -*- coding: utf-8 -*-
"""CheckAndfix non conformities
Test some of the recovery mechanisms implement in the CheckAndFix class.
"""
import
pytest
from
harvest_tools
import
CheckAndFix
from
invenio_tools
import
load_record
...
...
tests/harvest_tools/test_harvest_tools_functions.py
View file @
f33fc97b
# -*- coding: utf-8 -*-
"""test harvest_tools functions
"""
import
pytest
from
gluon
import
current
from
harvest_tools
import
search_synonym
,
ToolException
from
invenio_tools
import
load_record
...
...
@@ -14,10 +10,10 @@ def test_author_type():
"""Check the type of string returns by the author functions is unicode."""
record
=
load_record
(
'inspirehep.net'
,
1278588
)
assert
type
(
record
.
first_author
())
==
unicode
assert
type
(
record
.
first_author
())
==
str
for
author
in
record
.
authors_as_list
():
assert
type
(
author
)
==
unicode
assert
type
(
author
)
==
str
def
test_search_synonym
():
...
...
tests/invenio_tools/InvenioStore/test_invenio_cds1951625.py
View file @
f33fc97b
# -*- coding: utf-8 -*-
"""http://cds.cern.ch/record1951625
"""
...
...
tests/invenio_tools/InvenioStore/test_inveniostore.py
View file @
f33fc97b
# -*- coding: utf-8 -*-
"""test_inveniostore
"""
...
...
tests/invenio_tools/Marc12/test_marc.py
View file @
f33fc97b
# -*- coding: utf-8 -*-
"""test_marc
"""
import
pytest
from
invenio_tools
import
(
is_conference
,
is_institute
,
is_thesis
,
...
...
tests/invenio_tools/Record/test_acl_cds1753190.py
View file @
f33fc97b
# -*- coding: utf-8 -*-
"""ARTICLE
http://cds.cern.ch/record/1753190.
...
...
Prev
1
2
Next
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