當前位置: 首頁>>代碼示例>>Python>>正文


Python BaseDataHandler.execute_start_autosample方法代碼示例

本文整理匯總了Python中ion.agents.data.handlers.base_data_handler.BaseDataHandler.execute_start_autosample方法的典型用法代碼示例。如果您正苦於以下問題:Python BaseDataHandler.execute_start_autosample方法的具體用法?Python BaseDataHandler.execute_start_autosample怎麽用?Python BaseDataHandler.execute_start_autosample使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在ion.agents.data.handlers.base_data_handler.BaseDataHandler的用法示例。


在下文中一共展示了BaseDataHandler.execute_start_autosample方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: TestBaseDataHandlerUnit

# 需要導入模塊: from ion.agents.data.handlers.base_data_handler import BaseDataHandler [as 別名]
# 或者: from ion.agents.data.handlers.base_data_handler.BaseDataHandler import execute_start_autosample [as 別名]

#.........這裏部分代碼省略.........
        self._bdh.get.return_value = sentinel.ret_val
        ret = self._bdh.cmd_dvr('get_resource')
        self._bdh.get.assert_called_once()
        self.assertEquals(ret, sentinel.ret_val)

    def test_cmd_dvr_set(self):
        self._bdh.set = Mock()
        self._bdh.set.return_value = sentinel.ret_val
        ret = self._bdh.cmd_dvr('set_resource')
        self._bdh.set.assert_called_once()
        self.assertEquals(ret, sentinel.ret_val)

    def test_cmd_dvr_get_resource_params(self):
        self._bdh.get_resource_params = Mock()
        self._bdh.get_resource_params.return_value = sentinel.ret_val
        ret = self._bdh.cmd_dvr('get_resource_params')
        self._bdh.get_resource_params.assert_called_once()
        self.assertEquals(ret, sentinel.ret_val)

    def test_cmd_dvr_get_resource_commands(self):
        self._bdh.get_resource_commands = Mock()
        self._bdh.get_resource_commands.return_value = sentinel.ret_val
        ret = self._bdh.cmd_dvr('get_resource_commands')
        self._bdh.get_resource_commands.assert_called_once()
        self.assertEquals(ret, sentinel.ret_val)

    def test_cmd_dvr_execute_acquire_sample(self):
        self._bdh.execute_acquire_sample = Mock()
        self._bdh.execute_acquire_sample.return_value = sentinel.ret_val
        ret = self._bdh.cmd_dvr('execute_acquire_sample')
        self._bdh.execute_acquire_sample.assert_called_once()
        self.assertEquals(ret, sentinel.ret_val)

    def test_cmd_dvr_execute_start_autosample(self):
        self._bdh.execute_start_autosample = Mock()
        self._bdh.execute_start_autosample.return_value = sentinel.ret_val
        ret = self._bdh.cmd_dvr('execute_start_autosample')
        self._bdh.execute_start_autosample.assert_called_once()
        self.assertEquals(ret, sentinel.ret_val)

    def test_cmd_dvr_execute_stop_autosample(self):
        self._bdh.execute_stop_autosample = Mock()
        self._bdh.execute_stop_autosample.return_value = sentinel.ret_val
        ret = self._bdh.cmd_dvr('execute_stop_autosample')
        self._bdh.execute_stop_autosample.assert_called_once()
        self.assertEquals(ret, sentinel.ret_val)

    def _unused_cmd_log_output(self, cmd):
        return 'Command \'{0}\' not used by DataHandler'.format(cmd)

    @patch('ion.agents.data.handlers.base_data_handler.log')
    def test_cmd_dvr_execute_acquire_data(self, log_mock):
        ret = self._bdh.cmd_dvr('execute_acquire_data')
        self.assertIsNone(ret)
        self.assertEqual(log_mock.info.call_args[0][0], self._unused_cmd_log_output('execute_acquire_data'))

    @patch('ion.agents.data.handlers.base_data_handler.log')
    def test_cmd_dvr_configure(self, log_mock):
        ret = self._bdh.cmd_dvr('configure')
        self.assertIsNone(ret)
        self.assertEqual(log_mock.info.call_args[0][0], self._unused_cmd_log_output('configure'))

    @patch('ion.agents.data.handlers.base_data_handler.log')
    def test_cmd_dvr_connect(self, log_mock):
        ret = self._bdh.cmd_dvr('connect')
        self.assertIsNone(ret)
開發者ID:Bobfrat,項目名稱:coi-services,代碼行數:70,代碼來源:test_base_data_handler.py

示例2: TestBaseDataHandlerUnit

# 需要導入模塊: from ion.agents.data.handlers.base_data_handler import BaseDataHandler [as 別名]
# 或者: from ion.agents.data.handlers.base_data_handler.BaseDataHandler import execute_start_autosample [as 別名]

#.........這裏部分代碼省略.........
        self._bdh.get.return_value = sentinel.ret_val
        ret = self._bdh.cmd_dvr("get")
        self._bdh.get.assert_called_once()
        self.assertEquals(ret, sentinel.ret_val)

    def test_cmd_dvr_set(self):
        self._bdh.set = Mock()
        self._bdh.set.return_value = sentinel.ret_val
        ret = self._bdh.cmd_dvr("set")
        self._bdh.set.assert_called_once()
        self.assertEquals(ret, sentinel.ret_val)

    def test_cmd_dvr_get_resource_params(self):
        self._bdh.get_resource_params = Mock()
        self._bdh.get_resource_params.return_value = sentinel.ret_val
        ret = self._bdh.cmd_dvr("get_resource_params")
        self._bdh.get_resource_params.assert_called_once()
        self.assertEquals(ret, sentinel.ret_val)

    def test_cmd_dvr_get_resource_commands(self):
        self._bdh.get_resource_commands = Mock()
        self._bdh.get_resource_commands.return_value = sentinel.ret_val
        ret = self._bdh.cmd_dvr("get_resource_commands")
        self._bdh.get_resource_commands.assert_called_once()
        self.assertEquals(ret, sentinel.ret_val)

    def test_cmd_dvr_execute_acquire_data(self):
        self._bdh.execute_acquire_data = Mock()
        self._bdh.execute_acquire_data.return_value = sentinel.ret_val
        ret = self._bdh.cmd_dvr("execute_acquire_data")
        self._bdh.execute_acquire_data.assert_called_once()
        self.assertEquals(ret, sentinel.ret_val)

    def test_cmd_dvr_execute_start_autosample(self):
        self._bdh.execute_start_autosample = Mock()
        self._bdh.execute_start_autosample.return_value = sentinel.ret_val
        ret = self._bdh.cmd_dvr("execute_start_autosample")
        self._bdh.execute_start_autosample.assert_called_once()
        self.assertEquals(ret, sentinel.ret_val)

    def test_cmd_dvr_execute_stop_autosample(self):
        self._bdh.execute_stop_autosample = Mock()
        self._bdh.execute_stop_autosample.return_value = sentinel.ret_val
        ret = self._bdh.cmd_dvr("execute_stop_autosample")
        self._bdh.execute_stop_autosample.assert_called_once()
        self.assertEquals(ret, sentinel.ret_val)

    def _unused_cmd_log_output(self, cmd):
        return "Command '{0}' not used by DataHandler".format(cmd)

    @patch("ion.agents.data.handlers.base_data_handler.log")
    def test_cmd_dvr_execute_acquire_sample(self, log_mock):
        ret = self._bdh.cmd_dvr("execute_acquire_sample")
        self.assertIsNone(ret)
        self.assertEqual(log_mock.info.call_args[0][0], self._unused_cmd_log_output("execute_acquire_sample"))

    @patch("ion.agents.data.handlers.base_data_handler.log")
    def test_cmd_dvr_configure(self, log_mock):
        ret = self._bdh.cmd_dvr("configure")
        self.assertIsNone(ret)
        self.assertEqual(log_mock.info.call_args[0][0], self._unused_cmd_log_output("configure"))

    @patch("ion.agents.data.handlers.base_data_handler.log")
    def test_cmd_dvr_connect(self, log_mock):
        ret = self._bdh.cmd_dvr("connect")
        self.assertIsNone(ret)
開發者ID:pombredanne,項目名稱:coi-services,代碼行數:70,代碼來源:test_base_data_handler.py

示例3: TestBaseDataHandlerUnit

# 需要導入模塊: from ion.agents.data.handlers.base_data_handler import BaseDataHandler [as 別名]
# 或者: from ion.agents.data.handlers.base_data_handler.BaseDataHandler import execute_start_autosample [as 別名]

#.........這裏部分代碼省略.........
        self._bdh.get.return_value = sentinel.ret_val
        ret = self._bdh.cmd_dvr('get')
        self._bdh.get.assert_called_once()
        self.assertEquals(ret, sentinel.ret_val)

    def test_cmd_dvr_set(self):
        self._bdh.set = Mock()
        self._bdh.set.return_value = sentinel.ret_val
        ret = self._bdh.cmd_dvr('set')
        self._bdh.set.assert_called_once()
        self.assertEquals(ret, sentinel.ret_val)

    def test_cmd_dvr_get_resource_params(self):
        self._bdh.get_resource_params = Mock()
        self._bdh.get_resource_params.return_value = sentinel.ret_val
        ret = self._bdh.cmd_dvr('get_resource_params')
        self._bdh.get_resource_params.assert_called_once()
        self.assertEquals(ret, sentinel.ret_val)

    def test_cmd_dvr_get_resource_commands(self):
        self._bdh.get_resource_commands = Mock()
        self._bdh.get_resource_commands.return_value = sentinel.ret_val
        ret = self._bdh.cmd_dvr('get_resource_commands')
        self._bdh.get_resource_commands.assert_called_once()
        self.assertEquals(ret, sentinel.ret_val)

    def test_cmd_dvr_execute_acquire_data(self):
        self._bdh.execute_acquire_data = Mock()
        self._bdh.execute_acquire_data.return_value = sentinel.ret_val
        ret = self._bdh.cmd_dvr('execute_acquire_data')
        self._bdh.execute_acquire_data.assert_called_once()
        self.assertEquals(ret, sentinel.ret_val)

    def test_cmd_dvr_execute_start_autosample(self):
        self._bdh.execute_start_autosample = Mock()
        self._bdh.execute_start_autosample.return_value = sentinel.ret_val
        ret = self._bdh.cmd_dvr('execute_start_autosample')
        self._bdh.execute_start_autosample.assert_called_once()
        self.assertEquals(ret, sentinel.ret_val)

    def test_cmd_dvr_execute_stop_autosample(self):
        self._bdh.execute_stop_autosample = Mock()
        self._bdh.execute_stop_autosample.return_value = sentinel.ret_val
        ret = self._bdh.cmd_dvr('execute_stop_autosample')
        self._bdh.execute_stop_autosample.assert_called_once()
        self.assertEquals(ret, sentinel.ret_val)

    def _unused_cmd_log_output(self, cmd):
        return 'Command \'{0}\' not used by DataHandler'.format(cmd)

    @patch('ion.agents.data.handlers.base_data_handler.log')
    def test_cmd_dvr_execute_acquire_sample(self, log_mock):
        ret = self._bdh.cmd_dvr('execute_acquire_sample')
        self.assertIsNone(ret)
        self.assertEqual(log_mock.info.call_args[0][0], self._unused_cmd_log_output('execute_acquire_sample'))

    @patch('ion.agents.data.handlers.base_data_handler.log')
    def test_cmd_dvr_configure(self, log_mock):
        ret = self._bdh.cmd_dvr('configure')
        self.assertIsNone(ret)
        self.assertEqual(log_mock.info.call_args[0][0], self._unused_cmd_log_output('configure'))

    @patch('ion.agents.data.handlers.base_data_handler.log')
    def test_cmd_dvr_connect(self, log_mock):
        ret = self._bdh.cmd_dvr('connect')
        self.assertIsNone(ret)
開發者ID:dstuebe,項目名稱:coi-services,代碼行數:70,代碼來源:test_base_data_handler.py


注:本文中的ion.agents.data.handlers.base_data_handler.BaseDataHandler.execute_start_autosample方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。