Skip to content

Commit f5e01cc

Browse files
committed
Enhance execute_command_subprocess tests to validate output for both string and list commands
1 parent 76dddf1 commit f5e01cc

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

tests/module_utils/sap_automation_qa_test.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,9 +178,14 @@ def mock_get_logger(name):
178178
"src.module_utils.sap_automation_qa.logging.getLogger", mock_get_logger
179179
)
180180
sap_qa = SapAutomationQA()
181+
181182
command = "echo 'Hello World'"
182-
result = sap_qa.execute_command_subprocess(command)
183-
assert result == ""
183+
result = sap_qa.execute_command_subprocess(command, shell_command=True)
184+
assert "Hello World" in result
185+
186+
command_list = ["echo", "Hello World"]
187+
result_list = sap_qa.execute_command_subprocess(command_list, shell_command=False)
188+
assert "Hello World" in result_list
184189

185190
def test_parse_xml_output(self, monkeypatch):
186191
"""

0 commit comments

Comments
 (0)