本文整理汇总了Python中ion.agents.data.handlers.base_data_handler.BaseDataHandler._params方法的典型用法代码示例。如果您正苦于以下问题:Python BaseDataHandler._params方法的具体用法?Python BaseDataHandler._params怎么用?Python BaseDataHandler._params使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ion.agents.data.handlers.base_data_handler.BaseDataHandler
的用法示例。
在下文中一共展示了BaseDataHandler._params方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test__poll
# 需要导入模块: from ion.agents.data.handlers.base_data_handler import BaseDataHandler [as 别名]
# 或者: from ion.agents.data.handlers.base_data_handler.BaseDataHandler import _params [as 别名]
def test__poll(self, time_mock):
stream_route = Mock(spec=StreamRoute)
dh_config = {
'external_dataset_res_id': 'external_ds',
'stream_id': 'test_stream_id',
'stream_route': stream_route
}
bdh = BaseDataHandler(dh_config)
execute_acquire_sample_mock = MagicMock()
bdh.execute_acquire_sample = execute_acquire_sample_mock
bdh._params = {'POLLING_INTERVAL': 1}
glet = spawn(bdh._poll)
self.counter = 0
def inc_counter(*args):
self.counter += 1
if self.counter == 2:
bdh._polling = False
time_mock.sleep.side_effect = inc_counter
glet.join(timeout=5)
self.assertTrue(execute_acquire_sample_mock.call_count >= 1)
示例2: test__poll
# 需要导入模块: from ion.agents.data.handlers.base_data_handler import BaseDataHandler [as 别名]
# 或者: from ion.agents.data.handlers.base_data_handler.BaseDataHandler import _params [as 别名]
def test__poll(self, time_mock, execute_acquire_data_mock):
bdh=BaseDataHandler(None, None, None)
bdh._params = {'POLLING_INTERVAL':1}
glet = spawn(bdh._poll)
self.counter = 0
def inc_counter(*args):
self.counter += 1
if self.counter == 2:
bdh._polling = False
time_mock.sleep.side_effect = inc_counter
glet.join(timeout=5)
self.assertTrue(execute_acquire_data_mock.call_count >= 2)
示例3: test__poll
# 需要导入模块: from ion.agents.data.handlers.base_data_handler import BaseDataHandler [as 别名]
# 或者: from ion.agents.data.handlers.base_data_handler.BaseDataHandler import _params [as 别名]
def test__poll(self, time_mock, execute_acquire_data_mock):
self._stream_registrar = Mock()
dh_config = {"external_dataset_res_id": "external_ds"}
bdh = BaseDataHandler(self._stream_registrar, dh_config)
bdh._params = {"POLLING_INTERVAL": 1}
glet = spawn(bdh._poll)
self.counter = 0
def inc_counter(*args):
self.counter += 1
if self.counter == 2:
bdh._polling = False
time_mock.sleep.side_effect = inc_counter
glet.join(timeout=5)
self.assertTrue(execute_acquire_data_mock.call_count >= 1)