def test_on_comment(self, mock_ext): obj = BugzillaWorker(self.cfg, None) args = obj._setup_default_args() args.extend(("modify", "1", "--comment=xfoo bary")) # Command succeeds mock_ext.return_value = True obj.on_comment({"bugid": 1, "commit": {"author_name": "foo bar"}}) mock_ext.assert_called_once_with(args) # Command fails mock_ext.reset_mock() mock_ext.return_value = False obj.on_comment({"bugid": 1, "commit": {"author_name": "foo bar"}}) mock_ext.assert_called_once_with(args)