Skip to content

Commit

Permalink
Updated tests for removed RHEL 5 support
Browse files Browse the repository at this point in the history
  • Loading branch information
David Murphy authored and s0undt3ch committed Jun 17, 2023
1 parent 0a751cd commit 7ff5d0a
Showing 1 changed file with 0 additions and 30 deletions.
30 changes: 0 additions & 30 deletions tests/pytests/unit/modules/test_groupadd.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,18 +206,12 @@ def test_adduser():
"salt.utils.path.which",
MagicMock(
side_effect=[
None,
"/bin/gpasswd",
"/bin/usermod",
"/bin/gpasswd",
"/bin/usermod",
]
),
):
with patch.dict(groupadd.__grains__, os_version_list[0]["grains"]):
with pytest.raises(CommandExecutionError):
groupadd.adduser("test", "root")

for os_version in os_version_list:
mock = MagicMock(return_value={"retcode": 0})
with patch.dict(groupadd.__grains__, os_version["grains"]), patch.dict(
Expand Down Expand Up @@ -253,30 +247,12 @@ def test_deluser():
"salt.utils.path.which",
MagicMock(
side_effect=[
None,
"/bin/gpasswd",
"/bin/usermod",
"/bin/gpasswd",
"/bin/usermod",
]
),
):
with patch.dict(groupadd.__grains__, os_version_list[0]["grains"]), patch.dict(
groupadd.__salt__,
{
"group.info": MagicMock(
return_value={
"passwd": "*",
"gid": 0,
"name": "test",
"members": ["root"],
}
),
},
):
with pytest.raises(CommandExecutionError):
groupadd.deluser("test", "root")

for os_version in os_version_list:
mock_retcode = MagicMock(return_value=0)
mock_stdout = MagicMock(return_value="test foo")
Expand Down Expand Up @@ -328,8 +304,6 @@ def test_members():
"salt.utils.path.which",
MagicMock(
side_effect=[
None,
"/bin/gpasswd",
"/bin/gpasswd",
"/bin/groupmod",
"/bin/gpasswd",
Expand All @@ -339,10 +313,6 @@ def test_members():
]
),
):
with patch.dict(groupadd.__grains__, os_version_list[0]["grains"]):
with pytest.raises(CommandExecutionError):
groupadd.members("test", "foo")

for os_version in os_version_list:
mock_ret = MagicMock(return_value={"retcode": 0})
mock_stdout = MagicMock(return_value={"cmd.run_stdout": 1})
Expand Down

0 comments on commit 7ff5d0a

Please sign in to comment.