当前位置: 首页>>代码示例>>Python>>正文


Python BaseDataHandler.get_resource_commands方法代码示例

本文整理汇总了Python中ion.agents.data.handlers.base_data_handler.BaseDataHandler.get_resource_commands方法的典型用法代码示例。如果您正苦于以下问题:Python BaseDataHandler.get_resource_commands方法的具体用法?Python BaseDataHandler.get_resource_commands怎么用?Python BaseDataHandler.get_resource_commands使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ion.agents.data.handlers.base_data_handler.BaseDataHandler的用法示例。


在下文中一共展示了BaseDataHandler.get_resource_commands方法的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 get_resource_commands [as 别名]

#.........这里部分代码省略.........
        _get_data_mock.assert_called_once_with(config)
        _publish_data_mock.assert_called_once_with(publisher, data_generator, config, update_new_data_check_attachment)
        _constraints_for_historical_request_mock.assert_called_once_with(config)
        EventPublisher_mock.publish_event.assert_called_once()

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

    def test_cmd_dvr_get_resource(self):
        self._bdh.get = Mock()
        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):
开发者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 get_resource_commands [as 别名]

#.........这里部分代码省略.........
        _get_data_mock.assert_called_once_with(config)
        _publish_data_mock.assert_called_once_with(publisher, data_generator)
        _constraints_for_historical_request_mock.assert_called_once_with(config)
        EventPublisher_mock.publish_event.assert_called_once()

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

    def test_cmd_dvr_get(self):
        self._bdh.get = Mock()
        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):
开发者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 get_resource_commands [as 别名]

#.........这里部分代码省略.........
        _init_acquisition_cycle_mock.assert_called_once_with(config)
        _get_data_mock.assert_called_once_with(config)
        _publish_data_mock.assert_called_once_with(publisher, data_generator)
        EventPublisher_mock.publish_event.assert_called_once()

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

    def test_cmd_dvr_get(self):
        self._bdh.get = Mock()
        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):
开发者ID:dstuebe,项目名称:coi-services,代码行数:70,代码来源:test_base_data_handler.py


注:本文中的ion.agents.data.handlers.base_data_handler.BaseDataHandler.get_resource_commands方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。