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

Function test_start

tests/test_web_response.py:160–176  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

158
159@pytest.mark.run_loop
160def test_start():
161 req = make_request('GET', '/')
162 resp = StreamResponse()
163 assert resp.keep_alive is None
164
165 with mock.patch('aiohttp.web_reqrep.ResponseImpl'):
166 msg = yield from resp.prepare(req)
167
168 assert msg.send_headers.called
169 msg2 = yield from resp.prepare(req)
170 assert msg is msg2
171
172 assert resp.keep_alive
173
174 req2 = make_request('GET', '/')
175 with pytest.raises(RuntimeError):
176 yield from resp.prepare(req2)
177
178
179@pytest.mark.run_loop

Callers

nothing calls this directly

Calls 4

prepareMethod · 0.95
StreamResponseClass · 0.90
patchMethod · 0.80
make_requestFunction · 0.70

Tested by

no test coverage detected