Skip to content

Commit 9bd7e3c

Browse files
authored
Merge branch 'main' into pre-commit-ci-update-config
2 parents 804b550 + a3795e1 commit 9bd7e3c

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

tests/conftest.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,17 +67,16 @@ def check_download_collection(name: str, dest: Path) -> None:
6767
namespace, name = name.split(".")
6868
base_url = "https://galaxy.ansible.com/api/v3/plugin/ansible/content/published/collections"
6969

70-
url = f"{base_url}/index/{namespace}/{name}/versions/?is_highest=true"
70+
url = f"{base_url}/index/{namespace}/{name}/"
7171
try:
7272
with urlopen(url) as response: # noqa: S310
7373
body = response.read()
7474
except HTTPError:
7575
err = f"Failed to check collection version: {name}"
7676
pytest.fail(err)
77-
with urlopen(url) as response: # noqa: S310
78-
body = response.read()
77+
7978
json_response = json.loads(body)
80-
version = json_response["data"][0]["version"]
79+
version = json_response["highest_version"]["version"]
8180
file_name = f"{namespace}-{name}-{version}.tar.gz"
8281
file_path = dest / file_name
8382
if file_path.exists():

0 commit comments

Comments
 (0)