Skip to content

Commit

Permalink
Updated test per reviewer's comments
Browse files Browse the repository at this point in the history
  • Loading branch information
David Murphy committed Nov 9, 2023
1 parent 2a8eae6 commit a240206
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions tests/pytests/unit/modules/test_selinux.py
Original file line number Diff line number Diff line change
Expand Up @@ -399,15 +399,14 @@ def test_selinux_add_policy_regex(name, sel_type):
):
selinux.fcontext_add_policy(name, sel_type=sel_type)
filespec = re.escape(name)
filespec_test = f"'{filespec}'"
expected_cmd_shell = f"semanage fcontext -l | egrep {filespec_test}"
expected_cmd_shell = f"semanage fcontext -l | egrep '{filespec}'"
mock_cmd_shell.assert_called_once_with(
f"{expected_cmd_shell}",
expected_cmd_shell,
ignore_retcode=True,
)
expected_cmd_run_all = (
f"semanage fcontext --modify --type {sel_type} {filespec}"
)
mock_cmd_run_all.assert_called_once_with(
f"{expected_cmd_run_all}",
expected_cmd_run_all,
)

0 comments on commit a240206

Please sign in to comment.