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
c6872f3b
Commit
c6872f3b
authored
Jan 08, 2021
by
LE GAC Renaud
Browse files
Update test_02_factory_tools to work with REcordHep classes
parent
b030e0f1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
46 deletions
+11
-46
tests/basis/test_02_factory_tools.py
tests/basis/test_02_factory_tools.py
+11
-46
No files found.
tests/basis/test_02_factory_tools.py
View file @
c6872f3b
...
...
@@ -16,7 +16,9 @@ from store_tools.factory import (add_conference_data,
from
store_tools.pluginauthors
import
to_initial
from
store_tools.recordconf
import
RecordConf
from
store_tools.recordinst
import
RecordInst
from
store_tools.recordhepconf
import
RecordHepConf
from
store_tools.recordhepinst
import
RecordHepInst
from
store_tools.recordheppubli
import
RecordHepPubli
from
store_tools.recordpubli
import
RecordPubli
from
store_tools.recordthesis
import
RecordThesis
...
...
@@ -51,30 +53,7 @@ def test_get_conference_data_cds_02001():
assert
recjson1
==
recjson2
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
recjson1
=
get_conference_data
(
"inspirehep.net"
,
conf_id
=
980401
)
assert
recjson1
[
"control_number"
]
==
980401
assert
recjson1
[
"cnum"
]
==
"C10-12-06"
# by key
recjson2
=
get_conference_data
(
"inspirehep.net"
,
key
=
"C10-12-06"
)
assert
recjson2
[
"control_number"
]
==
980401
assert
recjson2
[
"cnum"
]
==
"C10-12-06"
# v1.4.0 remove obsolete test_get_conference_data_ins_02002
def
test_add_conference_data_cds_02003
():
...
...
@@ -111,21 +90,7 @@ def test_add_conference_data_cds_02004():
assert
recjson
[
"meeting_note"
][
"url"
]
==
\
"http://indico.ihep.ac.cn/event/5221/overview"
def
test_add_conference_data_ins_02005
():
store
=
build_store
(
"inspirehep.net"
,
shelf
=
"literature"
)
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
# v1.4.0 remove obsolete test_add_conference_data_ins_02005
def
test_conference_cds_02006
():
...
...
@@ -150,8 +115,8 @@ def test_conference_ins_02007():
assert
not
is_institute
(
recjson
)
assert
not
is_thesis
(
recjson
)
record
=
build_record
(
recjson
)
assert
isinstance
(
record
,
RecordConf
)
record
=
build_record
(
recjson
,
shelf
=
"literature"
)
assert
isinstance
(
record
,
Record
Hep
Conf
)
def
test_talk_cds_02008
():
...
...
@@ -183,8 +148,8 @@ def test_institute_ins_02010():
assert
is_institute
(
recjson
)
assert
not
is_thesis
(
recjson
)
record
=
build_record
(
recjson
)
assert
isinstance
(
record
,
RecordInst
)
record
=
build_record
(
recjson
,
shelf
=
"institutions"
)
assert
isinstance
(
record
,
Record
Hep
Inst
)
# ............................................................................
...
...
@@ -215,8 +180,8 @@ def test_article_inspirehep_02012():
assert
not
is_institute
(
recjson
)
assert
not
is_thesis
(
recjson
)
record
=
build_record
(
recjson
)
assert
isinstance
(
record
,
RecordPubli
)
record
=
build_record
(
recjson
,
shelf
=
"literature"
)
assert
isinstance
(
record
,
Record
Hep
Publi
)
# ............................................................................
...
...
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