mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 13:22:48 +00:00
pacman: improve docs, make sure that packages is always returned, deprecate update_cache behavior (#4330) (#4342)
* Improve docs, make sure that packages is always returned, deprecate update_cache behavior. * Add cache_updated return value. * Revert "Add cache_updated return value." This reverts commit367297bb5c. * Update tests/unit/plugins/modules/packaging/os/test_pacman.py Co-authored-by: Jean Raby <jean@raby.sh> Co-authored-by: Jean Raby <jean@raby.sh> (cherry picked from commit10ca62905f) Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
@@ -325,6 +325,7 @@ class TestPacman:
|
||||
P.run()
|
||||
self.mock_run_command.call_count == 0
|
||||
out = e.value.args[0]
|
||||
assert "packages" not in out
|
||||
assert out["changed"]
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
@@ -582,8 +583,8 @@ class TestPacman:
|
||||
with pytest.raises(AnsibleExitJson) as e:
|
||||
P.run()
|
||||
out = e.value.args[0]
|
||||
assert "packages" not in out
|
||||
assert not out["changed"]
|
||||
assert "packages" in out
|
||||
assert "diff" not in out
|
||||
self.mock_run_command.call_count == 0
|
||||
|
||||
@@ -1010,6 +1011,7 @@ class TestPacman:
|
||||
if raises == AnsibleExitJson:
|
||||
assert out["packages"] == expected_packages
|
||||
assert out["changed"]
|
||||
assert "packages" in out
|
||||
assert "diff" in out
|
||||
else:
|
||||
assert out["stdout"] == "stdout"
|
||||
|
||||
Reference in New Issue
Block a user