mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-04 19:26:58 +00:00
[PR #11391/b67c94fc backport][stable-12] fix ruff cases UP024,UP041 (#11394)
fix ruff cases UP024,UP041 (#11391)
* fix ruff cases UP024,UP041
* add changelog frag
(cherry picked from commit b67c94fc3f)
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
This commit is contained in:
parent
cd548f779a
commit
dda90768f5
5 changed files with 10 additions and 11 deletions
|
|
@ -255,7 +255,7 @@ def test_read_privateKey_handles_file_read_error():
|
|||
module = MagicMock()
|
||||
module.params = {"private_key_path": "/invalid/path.pem"}
|
||||
|
||||
with patch("builtins.open", side_effect=IOError("cannot read file")):
|
||||
with patch("builtins.open", side_effect=OSError("cannot read file")):
|
||||
jenkins_credential.read_privateKey(module)
|
||||
|
||||
module.fail_json.assert_called_once()
|
||||
|
|
@ -286,7 +286,7 @@ def test_embed_file_into_body_fails_when_file_unreadable():
|
|||
file_path = "/fake/path/missing.pem"
|
||||
credentials = {"id": "something"}
|
||||
|
||||
with patch("builtins.open", side_effect=IOError("can't read file")):
|
||||
with patch("builtins.open", side_effect=OSError("can't read file")):
|
||||
jenkins_credential.embed_file_into_body(module, file_path, credentials)
|
||||
|
||||
module.fail_json.assert_called_once()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue