MCPcopy Create free account
hub / github.com/EasyIME/PIME / test_multiple_add

Method test_multiple_add

python/python3/tornado/test/ioloop_test.py:99–116  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

97 self.wait()
98
99 def test_multiple_add(self):
100 sock, port = bind_unused_port()
101 try:
102 self.io_loop.add_handler(
103 sock.fileno(), lambda fd, events: None, IOLoop.READ
104 )
105 # Attempting to add the same handler twice fails
106 # (with a platform-dependent exception)
107 self.assertRaises(
108 Exception,
109 self.io_loop.add_handler,
110 sock.fileno(),
111 lambda fd, events: None,
112 IOLoop.READ,
113 )
114 finally:
115 self.io_loop.remove_handler(sock.fileno())
116 sock.close()
117
118 def test_remove_without_add(self):
119 # remove_handler should not throw an exception if called on an fd

Callers

nothing calls this directly

Calls 5

bind_unused_portFunction · 0.90
add_handlerMethod · 0.45
filenoMethod · 0.45
remove_handlerMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected