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
aa95850a
Commit
aa95850a
authored
Jan 28, 2020
by
LE GAC Renaud
Browse files
Update basis/test_09_Automaton.
parent
6f30b2f3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
10 deletions
+11
-10
tests/basis/test_09_Automaton.py
tests/basis/test_09_Automaton.py
+11
-10
No files found.
tests/basis/test_09_Automaton.py
View file @
aa95850a
# -*- coding: utf-8 -*-
"""test_08_Automaton
* Test Automaton methods
...
...
@@ -10,22 +9,24 @@ from gluon import current
from
harvest_tools.automaton
import
Automaton
from
harvest_tools.msgcollection
import
MsgCollection
from
invenio_tools.inveniostore
import
InvenioStore
from
plugin_dbui
import
get_id
@
pytest
.
fixture
(
scope
=
"module"
)
def
svc
():
db
=
current
.
db
# article for lhcb and for the current year
return
Automaton
(
current
.
db
,
7
,
8
,
return
Automaton
(
db
,
get_id
(
db
.
teams
,
team
=
"LHCb"
)
,
get_id
(
db
.
projects
,
project
=
"LHCb"
)
,
"article"
,
2
,
get_id
(
db
.
categories
,
code
=
"ACL"
)
,
year_start
=
current
.
request
.
now
.
year
,
dry_run
=
True
,
debug
=
True
)
def
test__is_record_in_db
(
svc
):
def
test__is_record_in_db
_09001
(
svc
):
"""The record cds1389970 and ins939619 describe the same LHCb paper.
* the paper is loaded in the database from cds.cern.ch.
...
...
@@ -60,7 +61,7 @@ def test__is_record_in_db(svc):
assert
rec_id_1
==
rec_id_2
def
test_process_recid
(
svc
):
def
test_process_recid
_09002
(
svc
):
"""Test the deepest method to retrieve a record.
"""
...
...
@@ -100,7 +101,7 @@ def test_process_recid(svc):
del
svc
.
store
def
test_process_collection
(
svc
):
def
test_process_collection
_09003
(
svc
):
# mimic the previous stage process_url
collection
=
u
"LHCb Papers"
...
...
@@ -121,12 +122,12 @@ def test_process_collection(svc):
del
svc
.
store
def
test_process_url_cds
(
svc
):
def
test_process_url_cds
_09004
(
svc
):
svc
.
dbg
=
True
assert
svc
.
process_url
(
"cds.cern.ch"
,
u
"LHCb Papers"
)
is
None
def
test_process_url_ins
(
svc
):
def
test_process_url_ins
_09005
(
svc
):
svc
.
dbg
=
True
assert
svc
.
process_url
(
"inspirehep.net"
,
"find cn lhcb and tc p and not tc c"
)
is
None
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