本文整理汇总了Python中Tribler.Test.Core.base_test.MockObject.notify方法的典型用法代码示例。如果您正苦于以下问题:Python MockObject.notify方法的具体用法?Python MockObject.notify怎么用?Python MockObject.notify使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tribler.Test.Core.base_test.MockObject
的用法示例。
在下文中一共展示了MockObject.notify方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: setUp
# 需要导入模块: from Tribler.Test.Core.base_test import MockObject [as 别名]
# 或者: from Tribler.Test.Core.base_test.MockObject import notify [as 别名]
def setUp(self):
"""
Setup some classes and files that are used by the tests in this module.
"""
yield super(BaseTestChannel, self).setUp()
self.fake_session = MockObject()
self.fake_session.add_observer = lambda a, b, c: False
self.fake_session_config = MockObject()
self.fake_session_config.get_state_dir = lambda: self.session_base_dir
self.fake_session.config = self.fake_session_config
fake_notifier = MockObject()
fake_notifier.add_observer = lambda a, b, c, d: False
fake_notifier.notify = lambda a, b, c, d: False
self.fake_session.notifier = fake_notifier
self.fake_channel_community = MockObject()
self.fake_channel_community.get_channel_id = lambda: 42
self.fake_channel_community.cid = 'a' * 20
self.fake_channel_community.get_channel_name = lambda: "my fancy channel"
self.channel_db_handler = self.session.open_dbhandler(NTFY_CHANNELCAST)
self.votecast_db_handler = self.session.open_dbhandler(NTFY_VOTECAST)
self.session.get_dispersy = lambda: True
self.session.lm.dispersy = Dispersy(ManualEnpoint(0), self.getStateDir())
示例2: setUp
# 需要导入模块: from Tribler.Test.Core.base_test import MockObject [as 别名]
# 或者: from Tribler.Test.Core.base_test.MockObject import notify [as 别名]
def setUp(self):
TriblerCoreTest.setUp(self)
self.lm = TriblerLaunchMany()
self.lm.session_lock = NoDispersyRLock()
self.lm.session = MockObject()
self.lm.session.config = MockObject()
self.lm.session.config.get_max_upload_rate = lambda: 100
self.lm.session.config.get_max_download_rate = lambda: 100
self.lm.session.config.get_default_number_hops = lambda: 0
# Ignore notifications
mock_notifier = MockObject()
mock_notifier.notify = lambda *_: None
self.lm.session.notifier = mock_notifier