本文整理汇总了Python中ion.agents.data.handlers.base_data_handler.BaseDataHandler.configure方法的典型用法代码示例。如果您正苦于以下问题:Python BaseDataHandler.configure方法的具体用法?Python BaseDataHandler.configure怎么用?Python BaseDataHandler.configure使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ion.agents.data.handlers.base_data_handler.BaseDataHandler
的用法示例。
在下文中一共展示了BaseDataHandler.configure方法的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 configure [as 别名]
#.........这里部分代码省略.........
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)
self.assertEqual(log_mock.info.call_args[0][0], self._unused_cmd_log_output('connect'))
@patch('ion.agents.data.handlers.base_data_handler.log')
def test_cmd_dvr_disconnect(self, log_mock):
ret = self._bdh.cmd_dvr('disconnect')
self.assertIsNone(ret)
self.assertEqual(log_mock.info.call_args[0][0], self._unused_cmd_log_output('disconnect'))
@patch('ion.agents.data.handlers.base_data_handler.log')
def test_cmd_dvr_get_current_state(self, log_mock):
ret = self._bdh.cmd_dvr('get_current_state')
self.assertIsNone(ret)
self.assertEqual(log_mock.info.call_args[0][0], self._unused_cmd_log_output('get_current_state'))
@patch('ion.agents.data.handlers.base_data_handler.log')
def test_cmd_dvr_discover(self, log_mock):
ret = self._bdh.cmd_dvr('discover')
self.assertIsNone(ret)
self.assertEqual(log_mock.info.call_args[0][0], self._unused_cmd_log_output('discover'))
def test_cmd_dvr_unknown_command(self):
self.assertRaises(InstrumentCommandException, self._bdh.cmd_dvr, 'unknown_command')
def test_initialize(self):
示例2: TestBaseDataHandlerUnit
# 需要导入模块: from ion.agents.data.handlers.base_data_handler import BaseDataHandler [as 别名]
# 或者: from ion.agents.data.handlers.base_data_handler.BaseDataHandler import configure [as 别名]
#.........这里部分代码省略.........
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)
self.assertEqual(log_mock.info.call_args[0][0], self._unused_cmd_log_output("connect"))
@patch("ion.agents.data.handlers.base_data_handler.log")
def test_cmd_dvr_disconnect(self, log_mock):
ret = self._bdh.cmd_dvr("disconnect")
self.assertIsNone(ret)
self.assertEqual(log_mock.info.call_args[0][0], self._unused_cmd_log_output("disconnect"))
@patch("ion.agents.data.handlers.base_data_handler.log")
def test_cmd_dvr_get_current_state(self, log_mock):
ret = self._bdh.cmd_dvr("get_current_state")
self.assertIsNone(ret)
self.assertEqual(log_mock.info.call_args[0][0], self._unused_cmd_log_output("get_current_state"))
@patch("ion.agents.data.handlers.base_data_handler.log")
def test_cmd_dvr_discover(self, log_mock):
ret = self._bdh.cmd_dvr("discover")
self.assertIsNone(ret)
self.assertEqual(log_mock.info.call_args[0][0], self._unused_cmd_log_output("discover"))
def test_cmd_dvr_unknown_command(self):
self.assertRaises(InstrumentCommandException, self._bdh.cmd_dvr, "unknown_command")
def test_initialize(self):
示例3: TestBaseDataHandlerUnit
# 需要导入模块: from ion.agents.data.handlers.base_data_handler import BaseDataHandler [as 别名]
# 或者: from ion.agents.data.handlers.base_data_handler.BaseDataHandler import configure [as 别名]
#.........这里部分代码省略.........
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)
self.assertEqual(log_mock.info.call_args[0][0], self._unused_cmd_log_output('connect'))
@patch('ion.agents.data.handlers.base_data_handler.log')
def test_cmd_dvr_disconnect(self, log_mock):
ret = self._bdh.cmd_dvr('disconnect')
self.assertIsNone(ret)
self.assertEqual(log_mock.info.call_args[0][0], self._unused_cmd_log_output('disconnect'))
@patch('ion.agents.data.handlers.base_data_handler.log')
def test_cmd_dvr_get_current_state(self, log_mock):
ret = self._bdh.cmd_dvr('get_current_state')
self.assertIsNone(ret)
self.assertEqual(log_mock.info.call_args[0][0], self._unused_cmd_log_output('get_current_state'))
@patch('ion.agents.data.handlers.base_data_handler.log')
def test_cmd_dvr_discover(self, log_mock):
ret = self._bdh.cmd_dvr('discover')
self.assertIsNone(ret)
self.assertEqual(log_mock.info.call_args[0][0], self._unused_cmd_log_output('discover'))
def test_cmd_dvr_unknown_command(self):
self.assertRaises(InstrumentCommandException, self._bdh.cmd_dvr, 'unknown_command')
def test_initialize(self):