def test_enable_task(self): cmd_mock = Mock(return_value={"retcode": 0}) with patch.dict(kapacitor.__salt__, {"cmd.run_all": cmd_mock}): kapacitor.enable_task("taskname") cmd_mock.assert_called_once_with( "kapacitor enable taskname", env=self.__class__.env )
def test_enable_task(self): cmd_mock = Mock(return_value={'retcode': 0}) with patch.dict(kapacitor.__salt__, {'cmd.run_all': cmd_mock}): kapacitor.enable_task('taskname') cmd_mock.assert_called_once_with('kapacitor enable taskname', env=self.__class__.env)
def test_enable_task(self): cmd_mock = Mock(return_value=True) with patch.dict(kapacitor.__salt__, {'cmd.retcode': cmd_mock}): kapacitor.enable_task('taskname') cmd_mock.assert_called_once_with('kapacitor enable taskname')