Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
python3-module-altrepo
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kirill Unitsaev
python3-module-altrepo
Commits
7b9b66d1
Verified
Commit
7b9b66d1
authored
Jun 20, 2026
by
Kirill Unitsaev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
api: update client models to API v2.2.7 schema
parent
ead56bb9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
89 additions
and
2 deletions
+89
-2
.gitignore
.gitignore
+1
-0
methods.py
altrepo/api/methods.py
+0
-0
models.py
altrepo/api/models.py
+0
-0
test_api_errata.py
tests/test_api_errata.py
+1
-0
test_api_site.py
tests/test_api_site.py
+7
-1
test_api_task.py
tests/test_api_task.py
+2
-1
test_openapi_conformance.py
tests/test_openapi_conformance.py
+78
-0
No files found.
.gitignore
View file @
7b9b66d1
...
...
@@ -4,3 +4,4 @@ __pycache__/
dist/
build/
.venv/
appstream/
altrepo/api/methods.py
View file @
7b9b66d1
This diff is collapsed.
Click to expand it.
altrepo/api/models.py
View file @
7b9b66d1
This diff is collapsed.
Click to expand it.
tests/test_api_errata.py
View file @
7b9b66d1
...
...
@@ -27,6 +27,7 @@ async def test_export_oval_branches(client):
assert
result
.
branches
@pytest.mark.timeout
(
120
)
async
def
test_export_oval_info
(
client
):
result
=
await
client
.
api
.
errata
.
export
.
oval
.
info
(
Branch
.
p11
)
assert
isinstance
(
result
,
bytes
)
...
...
tests/test_api_site.py
View file @
7b9b66d1
import
pytest
from
altrepo.api.errors
import
DataNotFoundError
from
altrepo.api.types
import
Branch
...
...
@@ -66,7 +67,12 @@ async def test_all_pkgsets_with_src_count(client):
async
def
test_beehive_errors_by_maintainer
(
client
):
result
=
await
client
.
api
.
site
.
beehive_errors_by_maintainer
(
Branch
.
sisyphus
,
"fiersik"
)
try
:
result
=
await
client
.
api
.
site
.
beehive_errors_by_maintainer
(
Branch
.
sisyphus
,
"fiersik"
)
except
DataNotFoundError
:
pytest
.
skip
(
"maintainer has no current beehive errors"
)
assert
result
...
...
tests/test_api_task.py
View file @
7b9b66d1
...
...
@@ -39,7 +39,8 @@ async def test_progress_last_tasks(client):
async
def
test_build_dependency_set
(
client
,
task_id
):
result
=
await
client
.
api
.
task
.
build_dependency_set
(
task_id
)
assert
result
.
id
==
task_id
assert
result
.
length
>=
0
assert
result
.
packages
is
not
None
async
def
test_task_info
(
client
,
task_id
):
...
...
tests/test_openapi_conformance.py
0 → 100644
View file @
7b9b66d1
import
ast
import
json
from
pathlib
import
Path
from
pydantic
import
BaseModel
from
altrepo.api
import
models
ROOT
=
Path
(
__file__
)
.
resolve
()
.
parents
[
1
]
def
_openapi
():
return
json
.
loads
((
ROOT
/
"openapi.json"
)
.
read_text
())
def
_normalize_path
(
path
:
str
,
openapi_paths
:
set
[
str
])
->
str
:
if
"{}"
not
in
path
:
return
path
parts
=
path
.
split
(
"/"
)
candidates
=
[]
for
candidate
in
openapi_paths
:
candidate_parts
=
candidate
.
split
(
"/"
)
if
len
(
parts
)
!=
len
(
candidate_parts
):
continue
if
all
(
(
part
==
"{}"
and
other
.
startswith
(
"{"
)
and
other
.
endswith
(
"}"
))
or
part
==
other
for
part
,
other
in
zip
(
parts
,
candidate_parts
)
):
candidates
.
append
(
candidate
)
return
candidates
[
0
]
if
len
(
candidates
)
==
1
else
path
def
test_all_openapi_schemas_have_models
():
schema_names
=
set
(
_openapi
()[
"components"
][
"schemas"
])
model_names
=
{
name
for
name
,
value
in
vars
(
models
)
.
items
()
if
isinstance
(
value
,
type
)
and
(
issubclass
(
value
,
BaseModel
)
or
name
in
schema_names
)
}
assert
schema_names
<=
model_names
def
test_client_endpoint_paths_match_openapi
():
openapi_paths
=
set
(
_openapi
()[
"paths"
])
tree
=
ast
.
parse
((
ROOT
/
"altrepo/api/methods.py"
)
.
read_text
())
client_paths
=
set
()
for
node
in
ast
.
walk
(
tree
):
if
not
isinstance
(
node
,
ast
.
Call
):
continue
if
not
isinstance
(
node
.
func
,
ast
.
Attribute
):
continue
if
node
.
func
.
attr
not
in
{
"get"
,
"post"
,
"get_text"
,
"get_bytes"
}:
continue
if
not
node
.
args
:
continue
arg
=
node
.
args
[
0
]
if
isinstance
(
arg
,
ast
.
Constant
)
and
isinstance
(
arg
.
value
,
str
):
value
=
arg
.
value
elif
isinstance
(
arg
,
ast
.
JoinedStr
):
value
=
""
.
join
(
part
.
value
if
isinstance
(
part
,
ast
.
Constant
)
else
"{}"
for
part
in
arg
.
values
)
else
:
continue
if
value
.
startswith
(
"/"
):
client_paths
.
add
(
_normalize_path
(
value
,
openapi_paths
))
assert
client_paths
-
openapi_paths
==
set
()
assert
(
openapi_paths
-
client_paths
)
<=
{
"/site/all_maintainers"
}
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