File tree Expand file tree Collapse file tree 4 files changed +41
-0
lines changed
Expand file tree Collapse file tree 4 files changed +41
-0
lines changed Original file line number Diff line number Diff line change 11name : Test
22
33on :
4+ schedule :
5+ # run once a month at midnight of the first day of the month
6+ - cron : 0 0 1 * *
47 workflow_call :
8+ workflow_dispatch : # run manually from actions tab
59
610# Set permissions at the job level.
711permissions : {}
3438 run : just cov
3539 env :
3640 TERM : dumb # keep rich from printing escape sequences, which made testing CLI outputs messy
41+ - name : Run e2e tests
42+ run : just e2e-test
43+ if : matrix.python-version == '3.13'
3744 - name : Generate coverage report
3845 run : |
3946 export TOTAL_COV=$(hatch run cov-total)
Original file line number Diff line number Diff line change @@ -33,6 +33,10 @@ check: lint typecheck
3333test :
3434 uv run pytest tests
3535
36+ [group (' test' )]
37+ e2e-test :
38+ uv run pytest -m e2e
39+
3640[group (' test' )]
3741cov :
3842 uv run pytest --cov=src
Original file line number Diff line number Diff line change @@ -170,6 +170,7 @@ addopts = [
170170 " --showlocals" ,
171171 " --strict-markers" ,
172172 " --strict-config" ,
173+ " -m not e2e" , # default behaviour: do not run e2e tests
173174]
174175asyncio_mode = " auto"
175176filterwarnings = [
@@ -178,6 +179,9 @@ filterwarnings = [
178179log_cli_level = " INFO"
179180xfail_strict = true
180181testpaths = " tests"
182+ markers = [
183+ " e2e: marks tests as end-to-end tests, requesting the live api" ,
184+ ]
181185
182186[tool .coverage .run ] # Ref: https://coverage.readthedocs.io/en/latest/config.html
183187branch = true
Original file line number Diff line number Diff line change 1+ # SPDX-FileCopyrightText: 2025 Heinz-Alexander Fütterer
2+ #
3+ # SPDX-License-Identifier: MIT
4+
5+ from __future__ import annotations
6+
7+ import pytest
8+
9+ import re3data
10+ from re3data ._resources import Repository , RepositoryName , RepositorySummary
11+
12+ pytestmark = pytest .mark .e2e
13+
14+
15+ def test_get_single_repository (zenodo_id : str ) -> None :
16+ response = re3data .repositories .get (zenodo_id )
17+ assert isinstance (response , Repository )
18+ assert response .id == zenodo_id
19+ assert isinstance (response .repository_name , RepositoryName )
20+ assert response .repository_name .value == "Zenodo"
21+
22+
23+ def test_list_repositories_query_string () -> None :
24+ response = re3data .repositories .list (query = "biosharing" )
25+ assert isinstance (response , list )
26+ assert isinstance (response [0 ], RepositorySummary )
You can’t perform that action at this time.
0 commit comments