(loop, app)
| 84 | |
| 85 | |
| 86 | def 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 | |
| 103 | def test_non_coroutine(loop, app): |
nothing calls this directly
no test coverage detected