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

Function test_response_prepare

tests/test_signals.py:86–100  ·  view source on GitHub ↗
(loop, app)

Source from the content-addressed store, hash-verified

84
85
86def test_response_prepare(loop, app):
87 callback = mock.Mock()
88
89 @asyncio.coroutine
90 def cb(*args, **kwargs):
91 callback(*args, **kwargs)
92
93 app.on_response_prepare.append(cb)
94
95 request = make_request(app, 'GET', '/')
96 response = Response(body=b'')
97 loop.run_until_complete(response.prepare(request))
98
99 callback.assert_called_once_with(request,
100 response)
101
102
103def test_non_coroutine(loop, app):

Callers

nothing calls this directly

Calls 4

ResponseClass · 0.90
appendMethod · 0.80
make_requestFunction · 0.70
prepareMethod · 0.45

Tested by

no test coverage detected