From ce10eba5746d2a7abd4da2e776beababd357d114 Mon Sep 17 00:00:00 2001 From: Mariam Ahhttouche Date: Mon, 16 Feb 2026 14:28:57 +0100 Subject: [PATCH] uv_python module: add integration test for case when specified version does not exist --- .../targets/uv_python/tasks/main.yaml | 33 +++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/tests/integration/targets/uv_python/tasks/main.yaml b/tests/integration/targets/uv_python/tasks/main.yaml index 2e58ea92de..7df14c8d0b 100644 --- a/tests/integration/targets/uv_python/tasks/main.yaml +++ b/tests/integration/targets/uv_python/tasks/main.yaml @@ -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"]' \ No newline at end of file + - '"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"]' \ No newline at end of file