本文整理匯總了Python中eventsocket.EventSocket._inactive_event方法的典型用法代碼示例。如果您正苦於以下問題:Python EventSocket._inactive_event方法的具體用法?Python EventSocket._inactive_event怎麽用?Python EventSocket._inactive_event使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類eventsocket.EventSocket
的用法示例。
在下文中一共展示了EventSocket._inactive_event方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_set_inactive_timeout_when_turning_off
# 需要導入模塊: from eventsocket import EventSocket [as 別名]
# 或者: from eventsocket.EventSocket import _inactive_event [as 別名]
def test_set_inactive_timeout_when_turning_off(self):
sock = EventSocket()
sock._inactive_event = mock()
expect( sock._inactive_event.delete )
sock.set_inactive_timeout(0)
assert_equals( None, sock._inactive_event )
assert_equals( 0, sock._inactive_timeout )
示例2: test_flag_activity
# 需要導入模塊: from eventsocket import EventSocket [as 別名]
# 或者: from eventsocket.EventSocket import _inactive_event [as 別名]
def test_flag_activity(self):
sock = EventSocket()
sock._inactive_event = mock()
sock._inactive_timeout = 42
expect( sock._inactive_event.delete )
expect( eventsocket.event.timeout ).args( 42, sock._protected_cb, sock._inactive_cb ).returns( 'doitagain' )
sock._flag_activity()
assert_equals( 'doitagain', sock._inactive_event )