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
321d9aa3
Commit
321d9aa3
authored
Jan 27, 2020
by
LE GAC Renaud
Browse files
Update basis/test_03_Record.
parent
eec5c1f9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
14 deletions
+16
-14
tests/basis/test_03_Record.py
tests/basis/test_03_Record.py
+16
-14
No files found.
tests/basis/test_03_Record.py
View file @
321d9aa3
# -*- coding: utf-8 -*-
"""test_03_Record
Test all methods of the Record class for a given article:
...
...
@@ -32,7 +31,7 @@ def recins():
return
Record
(
recjson
)
def
test__get
(
reccds
):
def
test__get
_cds_03001
(
reccds
):
assert
reccds
.
_get
(
"subject"
,
"source"
)
==
"arXiv"
assert
reccds
.
_get
(
"subject"
,
"source"
,
force_list
=
True
)
==
[
"arXiv"
]
...
...
@@ -41,47 +40,50 @@ def test__get(reccds):
assert
len
(
authors
)
==
reccds
[
"number_of_authors"
]
def
test__oai_url
(
reccds
):
def
test__oai_url
_cds_03002
(
reccds
):
oai
=
reccds
[
"oai"
][
"value"
]
assert
reccds
.
_oai_url
(
oai
)
==
"http://cds.cern.ch/record/1951625"
def
test_id
(
reccds
):
def
test_id
_cds_03003
(
reccds
):
assert
reccds
.
id
()
==
1951625
def
test_primary_oai
(
reccds
,
rec
in
s
):
def
test_primary_oai
_cds_03004
(
rec
cd
s
):
assert
reccds
.
primary_oai
()
==
"oai:cds.cern.ch:1951625"
assert
recins
.
primary_oai
()
==
"oai:inspirehep.net:1319638"
def
test_secondary_oai
(
reccds
,
recins
):
assert
reccds
.
secondary_oai
()
==
"oai:inspirehep.net:1319638"
assert
recins
.
secondary_oai
()
==
"oai:cds.cern.ch:1951625"
def
test_primary_oai_ins_03005
(
recins
):
assert
recins
.
primary_oai
()
==
"oai:inspirehep.net:1319638"
def
test_oai
(
reccd
s
,
recin
s
):
def
test_oai
_03006
(
reccds
):
assert
reccds
.
oai
()
==
\
"oai:cds.cern.ch:1951625, oai:inspirehep.net:1319638"
def
test_oai_ins_03007
(
reccds
,
recins
):
assert
recins
.
oai
()
==
\
"oai:inspirehep.net:1319638, oai:cds.cern.ch:1951625"
def
test_primary_oai_url
(
reccds
):
def
test_primary_oai_url
_cds_03008
(
reccds
):
assert
reccds
.
primary_oai_url
()
==
"http://cds.cern.ch/record/1951625"
def
test_secondary_oai_url
(
reccds
):
def
test_secondary_oai_url
_cds_03009
(
reccds
):
assert
reccds
.
secondary_oai_url
()
==
"http://inspirehep.net/record/1319638"
def
test_oai_url
(
reccds
):
def
test_oai_url
_cds_03010
(
reccds
):
assert
reccds
.
oai_url
()
==
\
"http://cds.cern.ch/record/1951625, "
\
"http://inspirehep.net/record/1319638"
def
test_host
(
reccds
,
rec
in
s
):
def
test_host
_cds_03011
(
rec
cd
s
):
assert
reccds
.
host
()
==
"cds.cern.ch"
def
test_host_ins_03012
(
recins
):
assert
recins
.
host
()
==
"inspirehep.net"
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