

def test_handle_request_io(self):

    def wsgi_app(env, start):
        start('200 OK', [('Content-Type', 'text/plain')])
        return io.BytesIO(b'data')
    srv = self._make_srv(wsgi_app)
    self.loop.run_until_complete(srv.handle_request(self.message, self.payload))
    content = b''.join([c[1][0] for c in self.writer.write.mock_calls])
    self.assertTrue(content.startswith(b'HTTP/1.0 200 OK'))
    self.assertTrue(content.endswith(b'data'))

dataset/ETHPy150Open KeepSafe/aiohttp/tests/test_wsgi.py TestHttpWsgiServerProtocol.test_handle_request_io/original