Add changelog, comment mock in test

This commit is contained in:
Twangboy 2022-11-14 19:14:29 -07:00 committed by Megan Wilhite
parent c0c8241bb4
commit 3cf602cd8a
2 changed files with 3 additions and 0 deletions

1
changelog/62152.fixed Normal file
View file

@ -0,0 +1 @@
Make sure lingering PAexec-*.exe files in the Windows directory are cleaned up

View file

@ -210,6 +210,8 @@ def test_run_psexec_command_cleanup_lingering_paexec():
pytest.importorskip("pypsexec.client", reason="Requires PyPsExec")
mock_psexec = patch("salt.utils.cloud.PsExecClient", autospec=True)
mock_scmr = patch("salt.utils.cloud.ScmrService", autospec=True)
# We're mocking 'remove_service' because all we care about is the cleanup
# command
mock_rm_svc = patch("salt.utils.cloud.Client.remove_service", autospec=True)
with mock_psexec as mock_client, mock_scmr, mock_rm_svc:
mock_client.return_value.session = MagicMock(username="Gary")