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
eec5c1f9
Commit
eec5c1f9
authored
Jan 27, 2020
by
LE GAC Renaud
Browse files
Update basis/test_02_record_factory.
parent
f724cb1f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
56 deletions
+42
-56
tests/basis/test_02_record_factory.py
tests/basis/test_02_record_factory.py
+42
-56
No files found.
tests/basis/test_02_record_factory.py
View file @
eec5c1f9
# -*- coding: utf-8 -*-
"""test_02_record_factory
* Test tools to introspect the type of record.
...
...
@@ -16,7 +15,6 @@ from invenio_tools.factory import (add_affiliation_keys,
get_conference_data
)
from
invenio_tools.inveniostore
import
InvenioStore
from
invenio_tools.record
import
Record
from
invenio_tools.recordconf
import
RecordConf
from
invenio_tools.recordinst
import
RecordInst
from
invenio_tools.recordpubli
import
RecordPubli
...
...
@@ -27,9 +25,8 @@ from invenio_tools.recordthesis import RecordThesis
#
# Conference proceeding and talk
#
def
test_get_conference_data
():
""" check the different approach to get the conference data
using the same proceeding, in both store cds.cern.ch and inspirehep.net.
def
test_get_conference_data_cds_02001
():
"""get the conference data from cds.cern.ch.
the map of identifiers and keys is the following:
...
...
@@ -42,11 +39,6 @@ def test_get_conference_data():
+------------------+--------------+-----------|
"""
# ........................................................................
#
# CDS
#
# by id
recjson1
=
get_conference_data
(
"cds.cern.ch"
,
conf_id
=
1181092
)
assert
recjson1
[
"recid"
]
==
1181092
...
...
@@ -59,11 +51,21 @@ def test_get_conference_data():
assert
recjson1
==
recjson2
# ........................................................................
#
# INSPIRE
#
def
test_get_conference_data_ins_02002
():
"""get the conference data from inspirehep.net.
the map of identifiers and keys is the following:
+------------------+--------------+-----------|
| | cds | inspire |
+------------------+--------------+-----------|
| proceeding recid | 1411352 | 1089237 |
| conference recid | 1181092 | 980401 |
| conference key | rome20101206 | C10-12-06 |
+------------------+--------------+-----------|
"""
# by id
recjson3
=
get_conference_data
(
"inspirehep.net"
,
conf_id
=
980401
)
assert
recjson3
[
"recid"
]
==
980401
...
...
@@ -76,25 +78,8 @@ def test_get_conference_data():
assert
recjson3
==
recjson4
def
test_add_conference_data
():
""" check the different approach to get the conference data
using the same proceeding, in both store cds.cern.ch and inspirehep.net.
the map of identifiers and keys is the following:
+------------------+--------------+-----------|
| | cds | inspire |
+------------------+--------------+-----------|
| proceeding recid | 1411352 | 1089237 |
| conference recid | 1181092 | 980401 |
| conference key | rome20101206 | C10-12-06 |
+------------------+--------------+-----------|
def
test_add_conference_data_cds_02003
():
"""
# ........................................................................
#
# CDS
#
store
=
InvenioStore
(
"cds.cern.ch"
)
recjson
=
store
.
get_record
(
1411352
)
...
...
@@ -108,23 +93,8 @@ def test_add_conference_data():
assert
recjson
[
"meeting_note"
][
"recid"
]
==
1181092
# ........................................................................
#
# INSPIRE
#
store
=
InvenioStore
(
"inspirehep.net"
)
recjson
=
store
.
get_record
(
1089237
)
add_conference_data
(
recjson
)
assert
"meeting_name"
in
recjson
assert
"meeting_note"
in
recjson
assert
recjson
[
"meeting_name"
][
0
][
"coference_code"
]
==
"C10-12-06"
assert
recjson
[
"meeting_note"
][
"url"
]
==
\
"http://www.roma1.infn.it/discrete10"
assert
recjson
[
"meeting_note"
][
"recid"
]
==
980401
def
test_add_conference_data_cds_02004
():
# ........................................................................
#
# EXCEPTION
...
...
@@ -143,7 +113,23 @@ def test_add_conference_data():
"http://indico.ihep.ac.cn/event/5221/overview"
def
test_conference_cds
():
def
test_add_conference_data_ins_02005
():
store
=
InvenioStore
(
"inspirehep.net"
)
recjson
=
store
.
get_record
(
1089237
)
add_conference_data
(
recjson
)
assert
"meeting_name"
in
recjson
assert
"meeting_note"
in
recjson
assert
recjson
[
"meeting_name"
][
0
][
"coference_code"
]
==
"C10-12-06"
assert
recjson
[
"meeting_note"
][
"url"
]
==
\
"http://www.roma1.infn.it/discrete10"
assert
recjson
[
"meeting_note"
][
"recid"
]
==
980401
def
test_conference_cds_02006
():
store
=
InvenioStore
(
"cds.cern.ch"
)
recjson
=
store
.
get_record
(
1411352
)
...
...
@@ -156,7 +142,7 @@ def test_conference_cds():
assert
isinstance
(
record
,
RecordConf
)
def
test_conference_ins
pirehep
():
def
test_conference_ins
_02007
():
store
=
InvenioStore
(
"inspirehep.net"
)
recjson
=
store
.
get_record
(
1276938
)
...
...
@@ -169,7 +155,7 @@ def test_conference_inspirehep():
assert
isinstance
(
record
,
RecordConf
)
def
test_talk_cds
():
def
test_talk_cds
_02008
():
store
=
InvenioStore
(
"cds.cern.ch"
)
recjson
=
store
.
get_record
(
2239092
)
...
...
@@ -186,7 +172,7 @@ def test_talk_cds():
#
# Institute
#
def
test_add_affiliation_keys
():
def
test_add_affiliation_keys
_ins_02009
():
"""CPPM"""
store
=
InvenioStore
(
"inspirehep.net"
)
recjson
=
store
.
get_record
(
902989
)
...
...
@@ -200,7 +186,7 @@ def test_add_affiliation_keys():
"CPPM, Marseille"
def
test_institute
():
def
test_institute
_ins_02010
():
"""CPPM"""
store
=
InvenioStore
(
"inspirehep.net"
)
recjson
=
store
.
get_record
(
902989
)
...
...
@@ -217,7 +203,7 @@ def test_institute():
#
# Article, ...
#
def
test_
publi_cds
():
def
test_
article_cds_02011
():
"""Precision luminosity measurements at LHCb"""
store
=
InvenioStore
(
"cds.cern.ch"
)
...
...
@@ -231,7 +217,7 @@ def test_publi_cds():
assert
isinstance
(
record
,
RecordPubli
)
def
test_
publi
_inspirehep
():
def
test_
article
_inspirehep
_02012
():
"""Precision luminosity measurements at LHCb"""
store
=
InvenioStore
(
"inspirehep.net"
)
...
...
@@ -249,7 +235,7 @@ def test_publi_inspirehep():
#
# Thesis
#
def
test_thesis_cds
():
def
test_thesis_cds
_02013
():
store
=
InvenioStore
(
"cds.cern.ch"
)
recjson
=
store
.
get_record
(
1632177
)
...
...
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