Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
eossr
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
Gitlab has been updated. More info
here
and
there
.
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
ESCAPE2020
WP3
eossr
Commits
d091bbe6
Commit
d091bbe6
authored
3 years ago
by
vuillaut
Browse files
Options
Downloads
Patches
Plain Diff
unit tests
parent
884de680
No related branches found
No related tags found
1 merge request
!15
api
Pipeline
#135645
failed
3 years ago
Stage: install
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
eossr/api/tests/test_api.py
+5
-14
5 additions, 14 deletions
eossr/api/tests/test_api.py
eossr/api/tests/test_zenodo.py
+8
-1
8 additions, 1 deletion
eossr/api/tests/test_zenodo.py
with
13 additions
and
15 deletions
eossr/api/tests/test_api.py
+
5
−
14
View file @
d091bbe6
from
eossr
import
api
import
pytest
@pytest.fixture
def
test_ossr
():
ossr
=
api
.
Ossr
()
def
test_get_ossr_records
():
ossr_records
=
api
.
get_ossr_records
()
assert
len
(
ossr_records
)
>=
15
# number of records September 10, 2021
all_ids
=
[
rec
.
data
[
'
id
'
]
for
rec
in
ossr_records
]
assert
4923992
in
all_ids
# id of the ESCAPE template project
template_search
=
ossr
.
search
(
'
ESCAPE template project
'
)
assert
len
(
template_search
)
>
0
return
template_search
[
0
]
def
test_pprint_record
(
test_ossr
):
api
.
pprint_record
(
test_ossr
)
def
test_get_all_ossr_records
():
ossr_records
=
api
.
get_all_ossr_records
()
assert
len
(
ossr_records
)
>=
15
# number of records September 10, 2021
\ No newline at end of file
This diff is collapsed.
Click to expand it.
eossr/api/tests/test_zenodo.py
+
8
−
1
View file @
d091bbe6
...
...
@@ -6,7 +6,7 @@ import requests
from
pathlib
import
Path
from
os
import
remove
from
os.path
import
dirname
,
realpath
,
join
from
eossr.api.zenodo
import
ZenodoAPI
from
eossr.api.zenodo
import
ZenodoAPI
,
get_zenodo_records
ROOT_DIR
=
dirname
(
realpath
(
"
codemeta.json
"
))
...
...
@@ -147,3 +147,10 @@ class TestZenodoAPI(unittest.TestCase):
json
.
load
(
f
)
remove
(
z
.
path_zenodo_metadata_file
)
def
test_get_zenodo_records
():
l
=
get_zenodo_records
(
'
ESCAPE template project
'
)
assert
len
(
l
)
>
1
all_dois
=
[
r
.
data
[
'
doi
'
]
for
r
in
l
]
assert
'
10.5281/zenodo.4923992
'
in
all_dois
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment