示例#1
0
 def test_define_task(self):
     cmd_mock = Mock(return_value=True)
     with patch.dict(kapacitor.__salt__, {'cmd.retcode': cmd_mock}):
         kapacitor.define_task('taskname', '/tmp/script.tick')
     cmd_mock.assert_called_once_with(
         'kapacitor define -name taskname -tick /tmp/script.tick -type stream'
     )
示例#2
0
 def test_define_task(self):
     cmd_mock = Mock(return_value={"retcode": 0})
     with patch.dict(kapacitor.__salt__, {"cmd.run_all": cmd_mock}):
         kapacitor.define_task("taskname", "/tmp/script.tick", dbrps=["db.rp"])
     cmd_mock.assert_called_once_with(
         "kapacitor define taskname -tick /tmp/script.tick -type stream -dbrp db.rp",
         env=self.__class__.env,
     )
示例#3
0
 def test_define_task(self):
     cmd_mock = Mock(return_value={'retcode': 0})
     with patch.dict(kapacitor.__salt__, {'cmd.run_all': cmd_mock}):
         kapacitor.define_task('taskname', '/tmp/script.tick')
     cmd_mock.assert_called_once_with(
         'kapacitor define taskname '
         '-tick /tmp/script.tick -type stream',
         env=self.__class__.env)