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
690d1783
Commit
690d1783
authored
Jan 27, 2020
by
LE GAC Renaud
Browse files
Update basis/test_04_RecordPubli.
parent
472e1cf3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
30 deletions
+36
-30
tests/basis/test_04_RecordPubli.py
tests/basis/test_04_RecordPubli.py
+36
-30
No files found.
tests/basis/test_04_RecordPubli.py
View file @
690d1783
# -*- coding: utf-8 -*-
"""test_04_RecordPubli
Test all methods of the RecordPubli class for a given article:
...
...
@@ -39,7 +38,7 @@ def recins():
return
load_record
(
"inspirehep.net"
,
1319638
)
def
test_constructor
(
reccds
):
def
test_constructor
_cds_04001
(
reccds
):
"""test the method _process_authors and _process_publication_info.
"""
...
...
@@ -68,7 +67,7 @@ def test_constructor(reccds):
assert
paper
.
pagination
==
"P12005"
def
test_to_initial
():
def
test_to_initial
_04002
():
assert
to_initial
(
u
"Albert"
)
==
u
"A."
assert
to_initial
(
u
"Antonio Augusto"
)
==
u
"A. A."
...
...
@@ -77,15 +76,16 @@ def test_to_initial():
assert
to_initial
(
u
"Marie-Hélène"
)
==
u
"M.-H."
assert
to_initial
(
u
"Marie - Pierre"
)
==
u
"M.-P."
# ............................................................................
#
# Section devoted to authors
#
def
test_is_authors
(
reccds
):
def
test_is_authors
_cds_04003
(
reccds
):
assert
reccds
.
is_authors
()
def
test_authors_as_list
(
reccds
):
def
test_authors_as_list
_cds_04004
(
reccds
):
authors
=
reccds
.
authors_as_list
()
assert
len
(
authors
)
==
reccds
[
"number_of_authors"
]
...
...
@@ -95,16 +95,16 @@ def test_authors_as_list(reccds):
assert
authors
[
-
1
]
==
u
"Zvyagin, Alexander"
def
test_first_author
(
reccds
):
def
test_first_author
_cds_04005
(
reccds
):
assert
reccds
.
first_author
()
==
u
"Aaij, Roel"
def
test_find_authors
(
reccds
):
def
test_find_authors
_cds_04006
(
reccds
):
assert
reccds
.
find_authors
(
"Leo"
)
==
\
u
"Beaucourt, Leo, Kravchuk, Leonid, Leo, Sabato"
def
test_reformat_author
(
reccds
):
def
test_reformat_author
_cds_04007
(
reccds
):
reccds
.
reformat_authors
(
"F. Last"
)
authors
=
reccds
.
authors_as_list
()
...
...
@@ -123,12 +123,12 @@ def test_reformat_author(reccds):
#
# Section devoted to affiliation
#
def
test_is_affiliations
(
reccds
):
def
test_is_affiliations
_cds_04008
(
reccds
):
assert
reccds
.
is_affiliations
()
assert
reccds
.
is_affiliation_for_all
()
def
test_institutes
(
reccds
):
def
test_institutes
_cds_04009
(
reccds
):
institutes
=
reccds
.
institutes
()
...
...
@@ -137,7 +137,7 @@ def test_institutes(reccds):
assert
institutes
[
-
1
]
==
"Zurich U."
def
test_find_affiliation
(
reccds
):
def
test_find_affiliation
_cds_04010
(
reccds
):
affiliation
=
reccds
.
find_affiliation
(
r
"Marseille, CPPM|CPPM, Marseille"
)
assert
affiliation
==
"Marseille, CPPM"
...
...
@@ -146,11 +146,11 @@ def test_find_affiliation(reccds):
#
# Section devoted to authors and institutes
#
def
test_first_author_institutes
(
reccds
):
def
test_first_author_institutes
_cds_04011
(
reccds
):
assert
reccds
.
first_author_institutes
()
==
"NIKHEF, Amsterdam"
def
test_find_authors_by_affiliation
(
reccds
):
def
test_find_authors_by_affiliation
_cds_04012
(
reccds
):
pattern
=
"CPPM, Marseille|Marseille, CPPM"
authors
=
reccds
.
find_authors_by_affiliation
(
pattern
,
sep
=
u
"|"
)
...
...
@@ -165,63 +165,69 @@ def test_find_authors_by_affiliation(reccds):
#
# Other methods
#
def
test_collaboration
(
reccds
):
def
test_collaboration
_cds_04013
(
reccds
):
assert
reccds
.
collaboration
()
==
"LHCb Collaboration"
def
test_is_published
(
reccds
):
def
test_is_published
_cds_04014
(
reccds
):
assert
reccds
.
is_published
()
# Paper is published but there are error in the paper reference
# Correct reference is Eur. Phys. J. C 75 (2015) 158
# But volume is not defined and pagination is wrong (75)
record
=
load_record
(
"cds.cern.ch"
,
1753190
)
assert
not
record
.
is_published
()
def
test_is_with_erratum
(
reccds
):
def
test_is_with_erratum
_cds_04015
(
reccds
):
assert
not
reccds
.
is_with_erratum
()
def
test_paper_info
(
reccds
,
rec
in
s
):
def
test_paper_info
_cds_04016
(
rec
cd
s
):
assert
reccds
.
paper_editor
()
==
"JINST"
assert
reccds
.
paper_pages
()
==
"P12005"
assert
reccds
.
paper_volume
()
==
"9"
assert
reccds
.
paper_year
()
==
"2014"
def
test_paper_info_ins_04017
(
recins
):
assert
recins
.
paper_editor
()
==
"JINST"
assert
recins
.
paper_pages
()
==
"P12005"
assert
recins
.
paper_volume
()
==
"9"
assert
recins
.
paper_year
()
==
"2014"
def
test_paper_reference
(
reccds
):
def
test_paper_reference_cds_04018
(
reccds
):
assert
reccds
.
paper_reference
()
==
"JINST 9 2014 P12005"
def
test_preprint_number
(
reccds
,
rec
in
s
):
def
test_preprint_number
_cds_04019
(
rec
cd
s
):
assert
reccds
.
preprint_number
()
==
"arXiv:1410.0149"
def
test_preprint_number_ins_04020
(
recins
):
assert
recins
.
preprint_number
()
==
"arXiv:1410.0149"
def
test_paper_url
(
reccds
,
rec
in
s
):
def
test_paper_url
_cds_04021
(
rec
cd
s
):
assert
reccds
.
paper_url
()
==
"http://arxiv.org/pdf/1410.0149.pdf"
def
test_paper_url_ins_04022
(
recins
):
assert
recins
.
paper_url
()
==
\
"http://inspirehep.net/record/1319638/files/arXiv:1410.0149.pdf"
def
test_report_number
(
reccds
,
rec
in
s
):
def
test_report_number
_cds_04023
(
rec
cd
s
):
assert
reccds
.
report_number
()
==
\
"CERN-PH-EP-2014-221, LHCB-PAPER-2014-047, LHCB-PAPER-2014-047-003"
def
test_report_number_ins_04024
(
recins
):
assert
recins
.
report_number
()
==
"CERN-PH-EP-2014-221, LHCB-PAPER-2014-047"
def
test_submitted
(
reccds
,
rec
in
s
):
def
test_submitted
_cds_04025
(
rec
cd
s
):
assert
reccds
.
submitted
()
==
"01 Oct 2014"
def
test_submitted_ins_04026
(
recins
):
assert
recins
.
submitted
()
==
"2014-10-01"
def
test_title
(
reccds
):
def
test_title
_cds_04027
(
reccds
):
assert
reccds
.
title
()
==
"Precision luminosity measurements at LHCb"
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