MCPcopy
hub / github.com/aio-libs/aiohttp / test_release

Method test_release

tests/test_connector.py:156–171  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

154 conn.close()
155
156 def test_release(self):
157 self.loop.time = mock.Mock(return_value=10)
158
159 conn = aiohttp.BaseConnector(loop=self.loop)
160 conn._start_cleanup_task = unittest.mock.Mock()
161 req = unittest.mock.Mock()
162 resp = req.response = unittest.mock.Mock()
163 resp._should_close = False
164
165 tr, proto = unittest.mock.Mock(), unittest.mock.Mock()
166 key = 1
167 conn._acquired[key].add(tr)
168 conn._release(key, req, tr, proto)
169 self.assertEqual(conn._conns[1][0], (tr, proto, 10))
170 self.assertTrue(conn._start_cleanup_task.called)
171 conn.close()
172
173 def test_release_close(self):
174 with self.assertWarns(DeprecationWarning):

Callers

nothing calls this directly

Calls 2

_releaseMethod · 0.95
closeMethod · 0.95

Tested by

no test coverage detected