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
a4170897
Commit
a4170897
authored
Jun 23, 2017
by
LE GAC Renaud
Browse files
Basic tests from 01 to 07 passed.
parent
76a3ae99
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
13 deletions
+31
-13
modules/invenio_tools/recordconf.py
modules/invenio_tools/recordconf.py
+13
-7
modules/invenio_tools/recordpubli.py
modules/invenio_tools/recordpubli.py
+6
-1
tests/basis/test_02_record_factory.py
tests/basis/test_02_record_factory.py
+3
-1
tests/basis/test_03_Record.py
tests/basis/test_03_Record.py
+9
-4
No files found.
modules/invenio_tools/recordconf.py
View file @
a4170897
...
...
@@ -10,13 +10,19 @@ class RecordConf(RecordPubli):
"""The record describing a conference talk or a proceeding.
Additional field describing the conference data are::
+---------------+-----------------------------------------------+
| field | subfield |
+---------------+-----------------------------------------------+
| meeting_name | closing_date, coference_code, country, date, |
| | location, opening_date, year |
| meeting_note | recid, url |
+---------------+-----------------------------------------------+
+----------------+-----------------------------------------------+
| field | subfield |
+----------------+-----------------------------------------------+
| meeting_name | closing_date, coference_code, country, date, |
| | location, opening_date, year |
+----------------+-----------------------------------------------+
One field is added by limbra:
+----------------+-----------------------------------------------+
| field (limbra) | subfield |
+----------------+-----------------------------------------------+
| meeting_note | recid, url |
+----------------+-----------------------------------------------+
"""
def
conference_country
(
self
):
...
...
modules/invenio_tools/recordpubli.py
View file @
a4170897
...
...
@@ -250,7 +250,12 @@ class RecordPubli(Record):
lambda
x
:
(
", "
.
join
(
set
(
x
))
if
isinstance
(
x
,
list
)
else
x
))
# erratum -- sort by year and volume
df
=
df
.
sort_values
([
"year"
,
"volume"
])
columns
=
df
.
columns
if
set
([
"year"
,
"volume"
]).
issubset
(
columns
):
df
=
df
.
sort_values
([
"year"
,
"volume"
])
elif
"year"
in
columns
:
df
=
df
.
sort_values
(
"year"
)
# replace
self
[
u
"publication_info"
]
=
df
...
...
tests/basis/test_02_record_factory.py
View file @
a4170897
...
...
@@ -178,7 +178,9 @@ def test_add_affiliation_keys():
assert
u
"corporate_note"
in
recjson
assert
recjson
[
u
"corporate_note"
][
u
"identifier"
]
==
"Marseille, CPPM"
assert
recjson
[
u
"corporate_note"
][
u
"futur_identifier"
]
==
"CPPM, Marseille"
assert
recjson
[
u
"corporate_note"
][
u
"future_identifier"
]
==
\
"CPPM, Marseille"
def
test_institute
():
...
...
tests/basis/test_03_Record.py
View file @
a4170897
...
...
@@ -13,20 +13,25 @@ Test all methods of the Record class for a given article:
"""
import
pytest
from
invenio_tools
import
load_record
from
invenio_tools.inveniostore
import
InvenioStore
from
invenio_tools.record
import
Record
@
pytest
.
fixture
(
scope
=
"module"
)
def
reccds
():
return
load_record
(
"cds.cern.ch"
,
1951625
)
store
=
InvenioStore
(
"cds.cern.ch"
)
recjson
=
store
.
get_record
(
1951625
)
return
Record
(
recjson
)
@
pytest
.
fixture
(
scope
=
"module"
)
def
recins
():
return
load_record
(
"inspirehep.net"
,
1319638
)
store
=
InvenioStore
(
"inspirehep.net"
)
recjson
=
store
.
get_record
(
1319638
)
return
Record
(
recjson
)
def
test_get
(
reccds
):
def
test_
_
get
(
reccds
):
assert
reccds
.
_get
(
"subject"
,
"source"
)
==
"arXiv"
assert
reccds
.
_get
(
"subject"
,
"source"
,
force_list
=
True
)
==
[
"arXiv"
]
...
...
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