1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00
community.general/tests/integration/targets/pipx/tasks/testcase-8809-installall.yml
patchback[bot] 73a1ac2f1c
[PR #8809/43f8adf1 backport][stable-9] pipx: add new states (#8834)
pipx: add new states (#8809)

* ensure minimum version of pip

* ensure pipx 1.7.0 is installed

* pipx: add new states/params

* add tests

* add license to json file

* Update plugins/modules/pipx.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* fix uninject tests

* add changelog frag

* fix doc per review

* refactor license out of pipx spec file

* Update plugins/modules/pipx.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update tests/integration/targets/pipx/files/spec.json.license

Co-authored-by: Felix Fontein <felix@fontein.de>

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 43f8adf1a5)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2024-09-07 09:37:47 +02:00

59 lines
1.6 KiB
YAML

---
# Copyright (c) Ansible Project
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later
- name: Set up environment
environment:
PATH: /usr/local/bin:{{ ansible_env.PATH }}
block:
- name: Uninstall pycowsay and black
community.general.pipx:
state: uninstall
name: "{{ item }}"
loop:
- black
- pycowsay
- name: Uninstall pycowsay and black (again)
community.general.pipx:
state: uninstall
name: "{{ item }}"
loop:
- black
- pycowsay
register: uninstall_all_1
- name: Use install-all
community.general.pipx:
state: install-all
spec_metadata: spec.json
register: install_all
- name: Run pycowsay (should succeed)
ansible.builtin.command: pycowsay Moooooooo!
changed_when: false
register: what_the_cow_said
- name: Which cow?
ansible.builtin.command: which pycowsay
changed_when: false
register: which_cow
- name: Uninstall pycowsay and black (again)
community.general.pipx:
state: uninstall
name: "{{ item }}"
loop:
- black
- pycowsay
register: uninstall_all_2
- name: Assert uninstall-all
ansible.builtin.assert:
that:
- uninstall_all_1 is not changed
- install_all is changed
- "'Moooooooo!' in what_the_cow_said.stdout"
- "'/usr/local/bin/pycowsay' in which_cow.stdout"
- uninstall_all_2 is changed