1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2026-03-22 05:09:12 +00:00

uv_python module: add integration test for case when specified version does not exist

This commit is contained in:
Mariam Ahhttouche 2026-02-16 14:28:57 +01:00
parent 9bbf6efe28
commit ce10eba574

View file

@ -172,7 +172,7 @@
ansible.builtin.assert:
that:
- invalid_version is failed
- "'Expected formats are X.Y or X.Y.Z' in invalid_version.msg"
- '"Expected formats are X.Y or X.Y.Z" in invalid_version.msg'
- name: Upgrade python 3.13
uv_python:
@ -199,4 +199,33 @@
that:
- upgrade_python["changed"] is false
- upgrade_python["failed"] is false
- '"3.13" in upgrade_python["msg"]'
- '"3.13" in upgrade_python["msg"]'
- name: Install unexisting python version
uv_python:
version: 3.12.13
state: present
register: unexisting_python
ignore_errors: true
- name: Verify python 3.13.5 deletion in check mode
assert:
that:
- unexisting_python["changed"] is false
- unexisting_python["failed"] is true
- '"No download found for request" in unexisting_python["msg"]'
- name: Install unexisting python version
uv_python:
version: 3.12.13
state: latest
register: unexisting_python
ignore_errors: true
- debug:
var: unexisting_python
- name: Verify python 3.13.5 deletion in check mode
assert:
that:
- unexisting_python["changed"] is false
- unexisting_python["failed"] is true
- '"Version 3.12.13 does not exist" in unexisting_python["msg"]'