本文整理汇总了Python中ion.agents.data.handlers.base_data_handler.BaseDataHandler._publish_data方法的典型用法代码示例。如果您正苦于以下问题:Python BaseDataHandler._publish_data方法的具体用法?Python BaseDataHandler._publish_data怎么用?Python BaseDataHandler._publish_data使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ion.agents.data.handlers.base_data_handler.BaseDataHandler
的用法示例。
在下文中一共展示了BaseDataHandler._publish_data方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test__publish_data_no_granules
# 需要导入模块: from ion.agents.data.handlers.base_data_handler import BaseDataHandler [as 别名]
# 或者: from ion.agents.data.handlers.base_data_handler.BaseDataHandler import _publish_data [as 别名]
def test__publish_data_no_granules(self, log_mock):
publisher = Mock()
granule1 = Mock()
granule2 = Mock()
granule3 = Mock()
data_generator = [granule1, granule2, granule3]
BaseDataHandler._publish_data(publisher=publisher, data_generator=data_generator)
self.assertEqual(publisher.publish.call_count, 0)
self.assertEqual(log_mock.warn.call_count, 3)
示例2: test__publish_data_with_granules
# 需要导入模块: from ion.agents.data.handlers.base_data_handler import BaseDataHandler [as 别名]
# 或者: from ion.agents.data.handlers.base_data_handler.BaseDataHandler import _publish_data [as 别名]
def test__publish_data_with_granules(self):
publisher = Mock()
granule1 = Mock(spec=Granule)
granule2 = Mock(spec=Granule)
granule3 = Mock(spec=Granule)
data_generator = [granule1, granule2, granule3]
BaseDataHandler._publish_data(publisher=publisher, data_generator=data_generator)
expected = [call(granule1), call(granule2), call(granule3)]
self.assertEqual(publisher.publish.call_args_list, expected)