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
e5772dd2
Commit
e5772dd2
authored
Jan 07, 2021
by
LE GAC Renaud
Browse files
Update to renumber tests
parent
9ad6058d
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
54 additions
and
54 deletions
+54
-54
tests/basis/test_06_RecordConf.py
tests/basis/test_06_RecordConf.py
+1
-1
tests/basis/test_08_RecordThesis.py
tests/basis/test_08_RecordThesis.py
+6
-6
tests/basis/test_10_RecordInst.py
tests/basis/test_10_RecordInst.py
+8
-8
tests/basis/test_11_CheckAndFix_base.py
tests/basis/test_11_CheckAndFix_base.py
+10
-10
tests/basis/test_12_Automaton.py
tests/basis/test_12_Automaton.py
+6
-6
tests/basis/test_13_CheckAndFix_article.py
tests/basis/test_13_CheckAndFix_article.py
+9
-9
tests/basis/test_14_CheckAndFix_proceeding.py
tests/basis/test_14_CheckAndFix_proceeding.py
+10
-10
tests/basis/test_15_CheckAndFix_thesis.py
tests/basis/test_15_CheckAndFix_thesis.py
+4
-4
No files found.
tests/basis/test_06_RecordConf.py
View file @
e5772dd2
"""test_0
5
_RecordConf
"""test_0
6
_RecordConf
Test specific methods of the RecordConf class for ::
...
...
tests/basis/test_0
7
_RecordThesis.py
→
tests/basis/test_0
8
_RecordThesis.py
View file @
e5772dd2
"""test_0
7
_RecordThesis
"""test_0
8
_RecordThesis
Test specific methods of the RecordThesis class for::
...
...
@@ -28,21 +28,21 @@ def reccds():
return
load_record
(
"cds.cern.ch"
,
1632177
)
def
test_authors_as_list_cds_0
7
001
(
reccds
):
def
test_authors_as_list_cds_0
8
001
(
reccds
):
assert
reccds
.
authors_as_list
()
==
[
u
'Chen, Liming'
]
def
test_these_defense_cds_0
7
002
(
reccds
):
def
test_these_defense_cds_0
8
002
(
reccds
):
assert
reccds
.
these_defense
()
==
"2013-12-10"
def
test_these_level_cds_0
7
003
(
reccds
):
def
test_these_level_cds_0
8
003
(
reccds
):
assert
reccds
.
these_level
()
==
"PhD"
def
test_these_directors_cds_0
7
004
(
reccds
):
def
test_these_directors_cds_0
8
004
(
reccds
):
assert
reccds
.
these_directors
(
sep
=
u
"|"
)
==
""
def
test_these_universities_cds_0
7
005
(
reccds
):
def
test_these_universities_cds_0
8
005
(
reccds
):
assert
reccds
.
these_universities
()
==
"Shandong U. & Marseille, CPPM"
tests/basis/test_0
8
_RecordInst.py
→
tests/basis/test_
1
0_RecordInst.py
View file @
e5772dd2
"""test_0
8
_Record
Thesis
"""test_
1
0_Record
Inst
Test specific methods of the RecordInst class for CPPM
...
...
@@ -13,36 +13,36 @@ def record():
return
load_record
(
"inspirehep.net"
,
902989
,
shelf
=
"institutions"
)
def
test_exception_host_ins_0
8
001
():
def
test_exception_host_ins_
1
0001
():
record
=
load_record
(
"cds.cern.ch"
,
1951625
)
with
pytest
.
raises
(
RecordException
):
RecordInst
(
record
)
def
test_exception_record_ins_0
8
002
():
def
test_exception_record_ins_
1
0002
():
record
=
load_record
(
"inspirehep.net"
,
1319638
,
shelf
=
"institutions"
)
with
pytest
.
raises
(
RecordException
):
RecordInst
(
record
)
def
test_future_identifer_ins_0
8
003
(
record
):
def
test_future_identifer_ins_
1
0003
(
record
):
assert
record
.
future_identifier
()
==
u
'CPPM, Marseille'
def
test_id_ins_0
8
004
(
record
):
def
test_id_ins_
1
0004
(
record
):
assert
record
.
id
()
==
902989
def
test_identifier_ins_0
8
005
(
record
):
def
test_identifier_ins_
1
0005
(
record
):
assert
record
.
identifier
()
==
u
'Marseille, CPPM'
def
test_name_ins_0
8
006
(
record
):
def
test_name_ins_
1
0006
(
record
):
assert
record
.
name
()
==
\
u
'Centre de Physique des Particules de Marseille (CPPM)'
def
test_rex_ins_0
8
007
(
record
):
def
test_rex_ins_
1
0007
(
record
):
assert
record
.
rex
()
==
\
r
"Marseille, CPPM|CPPM, Marseille|"
\
"Centre de Physique des Particules de Marseille (CPPM)"
tests/basis/test_
09
_CheckAndFix_base.py
→
tests/basis/test_
11
_CheckAndFix_base.py
View file @
e5772dd2
"""test_
09
_CheckAndFix_base
"""test_
11
_CheckAndFix_base
* Test CheckAndFix methods required by the Automaton base class.
- constructor
...
...
@@ -28,22 +28,22 @@ def svc():
return
CheckAndFix
()
def
test_constructor_
09
001
(
svc
):
def
test_constructor_
11
001
(
svc
):
assert
svc
.
reg_institute
==
\
r
"(^|\|)Marseille, CPPM($|\|)|"
\
r
"(^|\|)CPPM, Marseille($|\|)|"
\
r
"(^|\|)Centre de Physique des Particules de Marseille \(CPPM\)($|\|)"
def
test_is_oai_cds_
09
002
(
svc
,
reccds
):
def
test_is_oai_cds_
11
002
(
svc
,
reccds
):
assert
svc
.
is_oai
(
reccds
)
def
test_is_bad_oai_cds_
09
003
(
svc
,
reccds
):
def
test_is_bad_oai_cds_
11
003
(
svc
,
reccds
):
assert
not
svc
.
is_bad_oai_used
(
reccds
)
def
test_temporary_record_cds_
09
004
(
svc
,
reccds
):
def
test_temporary_record_cds_
11
004
(
svc
,
reccds
):
assert
svc
.
temporary_record
(
reccds
)
is
None
...
...
@@ -61,11 +61,11 @@ def test_temporary_record_cds_09004(svc, reccds):
svc
.
temporary_record
(
recins
)
def
test_authors_cds_
09
005
(
svc
,
reccds
):
def
test_authors_cds_
11
005
(
svc
,
reccds
):
assert
svc
.
authors
(
reccds
)
is
None
def
test__get_author_rescue_list_cds_
09
006
(
svc
,
reccds
):
def
test__get_author_rescue_list_cds_
11
006
(
svc
,
reccds
):
assert
svc
.
_get_author_rescue_list
(
reccds
,
8
,
7
)
==
[
"C. Adrover"
,
"S. Akar"
,
"E. Aslanides"
,
...
...
@@ -83,7 +83,7 @@ def test__get_author_rescue_list_cds_09006(svc, reccds):
"A. Tsaregorodtsev"
]
def
test_my_affiliation_cds_
09
007
(
svc
,
reccds
):
def
test_my_affiliation_cds_
11
007
(
svc
,
reccds
):
assert
svc
.
my_affiliation
(
reccds
,
8
,
7
)
==
"Marseille, CPPM"
# a paper from NA62 -- no CPPM author
...
...
@@ -92,7 +92,7 @@ def test_my_affiliation_cds_09007(svc, reccds):
svc
.
my_affiliation
(
recna62
,
id_project
=
8
,
id_team
=
7
)
def
test_search_synonym_
09
008
():
def
test_search_synonym_
11
008
():
db
=
current
.
db
# collaboration ANTARES, TANAMI (defined as synonym in the db)
...
...
@@ -116,5 +116,5 @@ def test_search_synonym_09008():
assert
colid
==
2
def
test_collaboration_cds_
09
009
(
svc
,
reccds
):
def
test_collaboration_cds_
11
009
(
svc
,
reccds
):
assert
svc
.
collaboration
(
reccds
)
is
None
tests/basis/test_1
0
_Automaton.py
→
tests/basis/test_1
2
_Automaton.py
View file @
e5772dd2
"""test_1
0
_Automaton
"""test_1
2
_Automaton
* Test Automaton methods
...
...
@@ -25,7 +25,7 @@ def svc():
dry_run
=
True
)
def
test__is_record_in_db_
0
1001
(
svc
):
def
test__is_record_in_db_1
2
001
(
svc
):
"""The record cds1389970 and ins939619 describe the same LHCb paper.
* the paper is loaded in the database from cds.cern.ch.
...
...
@@ -60,7 +60,7 @@ def test__is_record_in_db_01001(svc):
assert
rec_id_1
==
rec_id_2
def
test_process_recid_
0
1002
(
svc
):
def
test_process_recid_1
2
002
(
svc
):
"""Test the deepest method to retrieve a record.
"""
...
...
@@ -99,7 +99,7 @@ def test_process_recid_01002(svc):
del
svc
.
store
def
test_process_collection_
0
1003
(
svc
):
def
test_process_collection_1
2
003
(
svc
):
# mimic the previous stage process_url
collection
=
"LHCb Papers"
...
...
@@ -119,10 +119,10 @@ def test_process_collection_01003(svc):
del
svc
.
store
def
test_process_url_cds_
0
1004
(
svc
):
def
test_process_url_cds_1
2
004
(
svc
):
assert
svc
.
process_url
(
"cds.cern.ch"
,
"LHCb Papers"
)
is
None
def
test_process_url_ins_
0
1005
(
svc
):
def
test_process_url_ins_1
2
005
(
svc
):
assert
svc
.
process_url
(
"inspirehep.net"
,
"find cn lhcb and tc p and not tc c"
)
is
None
tests/basis/test_1
1
_CheckAndFix_article.py
→
tests/basis/test_1
3
_CheckAndFix_article.py
View file @
e5772dd2
"""test_1
1
_CheckAndFix_article
"""test_1
3
_CheckAndFix_article
* Test CheckAndFix methods for article:
- format_editor
...
...
@@ -33,7 +33,7 @@ def svc():
return
CheckAndFix
()
def
test_format_editor_cds_1
1
001
(
svc
,
reccds
):
def
test_format_editor_cds_1
3
001
(
svc
,
reccds
):
# cds
assert
reccds
.
paper_editor
()
==
"Phys. Rev. D"
...
...
@@ -45,7 +45,7 @@ def test_format_editor_cds_11001(svc, reccds):
assert
reccds
.
paper_volume
()
==
"95"
def
test_format_editor_ins_1
1
002
(
svc
,
recins
):
def
test_format_editor_ins_1
3
002
(
svc
,
recins
):
# inspire
assert
recins
.
paper_editor
()
==
"Phys.Rev."
assert
recins
.
paper_volume
()
==
"D95"
...
...
@@ -56,11 +56,11 @@ def test_format_editor_ins_11002(svc, recins):
assert
recins
.
paper_volume
()
==
"95"
def
test_publisher_cds_1
1
003
(
svc
,
reccds
):
def
test_publisher_cds_1
3
003
(
svc
,
reccds
):
assert
svc
.
publisher
(
reccds
)
is
None
def
test_paper_reference_cds_1
1
004
(
svc
,
reccds
):
def
test_paper_reference_cds_1
3
004
(
svc
,
reccds
):
# check recovery procedure using DOI
# remove the publisher and volume information
...
...
@@ -72,7 +72,7 @@ def test_paper_reference_cds_11004(svc, reccds):
assert
reccds
.
paper_reference
()
==
paper_ref
def
test_submitted_cds_1
1
005
(
svc
,
reccds
):
def
test_submitted_cds_1
3
005
(
svc
,
reccds
):
assert
reccds
.
submitted
()
==
"19 Jan 2017"
svc
.
submitted
(
reccds
)
...
...
@@ -89,12 +89,12 @@ def test_submitted_cds_11005(svc, reccds):
assert
reccds
.
submitted
()
==
"2017-01"
def
test_submitted_ins_1
1
006
(
svc
,
recins
):
def
test_submitted_ins_1
3
006
(
svc
,
recins
):
assert
recins
.
submitted
()
==
"2017-01-19"
def
test_format_authors_cds_1
1
007
(
svc
,
reccds
):
def
test_format_authors_cds_1
3
007
(
svc
,
reccds
):
authors
=
reccds
.
authors_as_list
()
...
...
@@ -113,7 +113,7 @@ def test_format_authors_cds_11007(svc, reccds):
assert
authors
[
-
1
]
==
"S. Zucchelli"
def
test_get_my_authors_cds_1
1
008
(
svc
,
reccds
):
def
test_get_my_authors_cds_1
3
008
(
svc
,
reccds
):
svc
.
format_authors
(
reccds
,
fmt
=
"F. Last"
)
assert
svc
.
get_my_authors
(
reccds
,
sep
=
"|"
,
sort
=
True
)
is
None
...
...
tests/basis/test_1
2
_CheckAndFix_proceeding.py
→
tests/basis/test_1
4
_CheckAndFix_proceeding.py
View file @
e5772dd2
"""test_1
2
_CheckAndFix_proceeding
"""test_1
4
_CheckAndFix_proceeding
* Test CheckAndFix methods for proceeding.
Use the same proceeding in cds.cern.ch and inspirehep.net
...
...
@@ -39,7 +39,7 @@ def svc():
return
CheckAndFix
()
def
test_is_conference_cds_1
2
001
(
svc
,
reccds
):
def
test_is_conference_cds_1
4
001
(
svc
,
reccds
):
assert
svc
.
is_conference
(
reccds
)
is
None
# test exception
...
...
@@ -50,26 +50,26 @@ def test_is_conference_cds_12001(svc, reccds):
svc
.
is_conference
(
reccds2
)
def
test_is_conference_ins_1
2
002
(
svc
,
recins
):
def
test_is_conference_ins_1
4
002
(
svc
,
recins
):
assert
svc
.
is_conference
(
recins
)
is
None
def
test_country_cds_1
2
003
(
svc
,
reccds
):
def
test_country_cds_1
4
003
(
svc
,
reccds
):
assert
svc
.
country
(
reccds
)
is
None
def
test_country_ins_1
2
004
(
svc
,
recins
):
def
test_country_ins_1
4
004
(
svc
,
recins
):
assert
svc
.
country
(
recins
)
is
None
def
test_conference_date_cds_1
2
005
(
svc
,
reccds
):
def
test_conference_date_cds_1
4
005
(
svc
,
reccds
):
assert
reccds
.
conference_dates
()
==
"6 - 11 Dec 2010"
svc
.
conference_date
(
reccds
)
assert
reccds
.
conference_dates
()
==
"6-11 Dec 2010"
def
test_conference_date_cds_1
2
006
(
svc
):
def
test_conference_date_cds_1
4
006
(
svc
):
reccds
=
load_record
(
"cds.cern.ch"
,
2688580
)
assert
reccds
.
conference_dates
()
==
"04-06 Sept 2019"
...
...
@@ -78,20 +78,20 @@ def test_conference_date_cds_12006(svc):
assert
reccds
.
conference_dates
()
==
"4-6 Sep 2019"
def
test_conference_date_ins_1
2
007
(
svc
,
recins
):
def
test_conference_date_ins_1
4
007
(
svc
,
recins
):
assert
recins
.
conference_dates
()
==
"6-11 Dec 2010"
svc
.
conference_date
(
recins
)
assert
recins
.
conference_dates
()
==
"6-11 Dec 2010"
def
test_submitted_cds_1
2
008
(
svc
,
reccds
):
def
test_submitted_cds_1
4
008
(
svc
,
reccds
):
assert
reccds
.
submitted
()
==
"05 Jan 2012"
svc
.
submitted
(
reccds
)
assert
reccds
.
submitted
()
==
"2012-01-05"
def
test_submitted_ins_1
2
009
(
svc
,
recins
):
def
test_submitted_ins_1
4
009
(
svc
,
recins
):
assert
recins
.
submitted
()
==
"2011"
svc
.
submitted
(
recins
)
assert
recins
.
submitted
()
==
"2010-12-06"
tests/basis/test_1
3
_CheckAndFix_thesis.py
→
tests/basis/test_1
5
_CheckAndFix_thesis.py
View file @
e5772dd2
"""test_1
3
_CheckAndFix_thesis
"""test_1
5
_CheckAndFix_thesis
* Test CheckAndFix methods for thesis.
Use the one talk in cds.cern.ch
...
...
@@ -26,11 +26,11 @@ def svc():
return
CheckAndFix
()
def
test_is_thesis_cds_1
3
001
(
svc
,
reccds
):
def
test_is_thesis_cds_1
5
001
(
svc
,
reccds
):
assert
svc
.
is_thesis
(
reccds
)
is
None
def
test_submitted_cds_1
3
002
(
svc
,
reccds
):
def
test_submitted_cds_1
5
002
(
svc
,
reccds
):
assert
reccds
.
these_defense
()
==
"2011"
assert
reccds
.
submitted
()
==
""
...
...
@@ -39,7 +39,7 @@ def test_submitted_cds_13002(svc, reccds):
assert
reccds
.
submitted
()
==
"2011-11"
def
test_format_universities_cds_1
3
003
(
svc
,
reccds
):
def
test_format_universities_cds_1
5
003
(
svc
,
reccds
):
# Khanji en 2011 (Université de la Méditerrannée)
assert
reccds
[
"dissertation_note"
][
"university"
]
==
\
...
...
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