-
Notifications
You must be signed in to change notification settings - Fork 123
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add missing prn on the DistributionTree serializer
- Loading branch information
Showing
3 changed files
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import pytest | ||
import requests | ||
|
||
|
||
|
||
# @pytest.fixture(scope="session") | ||
# def pulp_openapi_schema_rpm(pulp_api_v3_url): | ||
# COMPONENT="rpm" | ||
# return requests.get(f"{pulp_api_v3_url}docs/api.json?bindings&component={COMPONENT}").json() | ||
|
||
@pytest.mark.parallel | ||
def test_prn_schema(pulp_openapi_schema): | ||
"""Test that PRN is a part of every serializer with a pulp_href.""" | ||
failed = [] | ||
for name, schema in pulp_openapi_schema["components"]["schemas"].items(): | ||
if name.endswith("Response"): | ||
if "pulp_href" in schema["properties"]: | ||
if "prn" in schema["properties"]: | ||
prn_schema = schema["properties"]["prn"] | ||
if prn_schema["type"] == "string" and prn_schema["readOnly"]: | ||
continue | ||
failed.append(name) | ||
|
||
assert len(failed) == 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters