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 )
  def test_set_inactive_timeout_when_turning_off(self):
    sock = EventSocket()
    sock._inactive_event = mock()
    
    expect( sock._inactive_event.delete )
    expect( eventsocket.event.timeout ).args( 32, sock._inactive_cb ).returns( 'new_timeout' )

    sock.set_inactive_timeout(32)
    assert_equals( 'new_timeout', sock._inactive_event )
    assert_equals( 32, sock._inactive_timeout )