-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixes #752
- Loading branch information
Showing
6 changed files
with
36 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Made api-quirks idempotent to prevent them from failing once the original api is fixed. |
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
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# type: ignore | ||
|
||
import os | ||
import pathlib | ||
import subprocess | ||
|
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,27 @@ | ||
import typing as t | ||
from copy import deepcopy | ||
|
||
import pytest | ||
from pulp_glue.common.context import PulpContext | ||
|
||
|
||
@pytest.mark.glue | ||
def test_api_quirks_idempotent( | ||
pulp_cli_settings: t.Tuple[t.Any, t.Dict[str, t.Dict[str, t.Any]]] | ||
) -> None: | ||
""" | ||
Test, that the applied api quirks can be applied twice without failing. | ||
This can let us hope they will not fail once the api is fixed upstream. | ||
""" | ||
settings = pulp_cli_settings[1]["cli"] | ||
pulp_ctx = PulpContext( | ||
api_kwargs={"base_url": settings["base_url"]}, | ||
api_root=settings.get("api_root", "pulp/"), | ||
background_tasks=False, | ||
timeout=settings.get("timeout", 120), | ||
) | ||
patched_once_api = deepcopy(pulp_ctx.api.api_spec) | ||
# Patch a second time | ||
pulp_ctx._patch_api_spec() | ||
assert pulp_ctx.api.api_spec == patched_once_api |