def test_started_state_generate_valid_cli_command(self): mock_func = MagicMock(return_value={"retcode": 0, "stdout": "", "pid": 1000}) with patch.dict(syslog_ng.__salt__, _SALT_VAR_WITH_MODULE_METHODS): with patch.dict(syslog_ng_module.__salt__, {'cmd.run_all': mock_func}): got = syslog_ng.started(user="******", group="users", enable_core=True) command = got["changes"]["new"] self.assertTrue( command.endswith("syslog-ng --user=joe --group=users --enable-core --cfgfile=/etc/syslog-ng.conf"))