nagios-charmers team mailing list archive
-
nagios-charmers team
-
Mailing list archive
-
Message #00513
[Merge] ~xavpaice/hw-health-charm:fix_clear_sel_unittest into hw-health-charm:master
Xav Paice has proposed merging ~xavpaice/hw-health-charm:fix_clear_sel_unittest into hw-health-charm:master.
Commit message:
fix unit tests for clear-sel action
Requested reviews:
Canonical IS Reviewers (canonical-is-reviewers)
Nagios Charm developers (nagios-charmers)
For more details, see:
https://code.launchpad.net/~xavpaice/hw-health-charm/+git/hw-health-charm/+merge/369224
--
Your team Nagios Charm developers is requested to review the proposed merge of ~xavpaice/hw-health-charm:fix_clear_sel_unittest into hw-health-charm:master.
diff --git a/src/tests/unit/test_actions.py b/src/tests/unit/test_actions.py
index 9cf5ab6..320d99f 100644
--- a/src/tests/unit/test_actions.py
+++ b/src/tests/unit/test_actions.py
@@ -24,8 +24,8 @@ class ClearSelTestCase(unittest.TestCase):
@mock.patch('subprocess.check_output')
@mock.patch('subprocess.check_call')
def test_clear_sel(self, mock_check_call, mock_subprocess, mock_log):
- sel_output = "Unittest system event log output"
+ sel_output = "Unittest system event log output".encode()
mock_subprocess.return_value = sel_output
mock_check_call.return_value = None
- clear_sel('dummy_arg')
- mock_check_call.assert_called_once_with(['action-set', "cleared_log={}".format(sel_output)])
+ clear_sel()
+ mock_check_call.assert_called_once_with(['action-set', "message={}".format(sel_output.decode())])
References