def setUp(self):
    self.loop = asyncio.new_event_loop()
    asyncio.set_event_loop(None)
    self.wsgi = mock.Mock()
    self.reader = mock.Mock()
    self.writer = mock.Mock()
    self.writer.drain.return_value = ()
    self.transport = mock.Mock()
    self.transport.get_extra_info.side_effect = [mock.Mock(family=socket.AF_INET), ('1.2.3.4', 1234), ('2.3.4.5', 80)]
    self.headers = multidict.MultiDict({'HOST': 'python.org'})
    self.raw_headers = [(b'HOST', b'python.org')]
    self.message = protocol.RawRequestMessage('GET', '/path', (1, 0), self.headers, self.raw_headers, True, 'deflate')
    self.payload = aiohttp.FlowControlDataQueue(self.reader)
    self.payload.feed_data(b'data', 4)
    self.payload.feed_data(b'data', 4)
    self.payload.feed_eof()
def setUp(self):
    self.loop = asyncio.new_event_loop()
    asyncio.set_event_loop(None)
    self.wsgi = mock.Mock()
    self.reader = mock.Mock()
    self.writer = mock.Mock()
    self.writer.drain.return_value = ()
    self.transport = mock.Mock()
    self.transport.get_extra_info.side_effect = [mock.Mock(family=socket.AF_INET), ('1.2.3.4', 1234), ('2.3.4.5', 80)]
    self.headers = multidict.MultiDict({'HOST': 'python.org'})
    self.raw_headers = [(b'HOST', b'python.org')]
    self.message = protocol.RawRequestMessage('GET', '/path', (1, 0), self.headers, self.raw_headers, True, 'deflate')
    self.payload = aiohttp.FlowControlDataQueue(self.reader)
    self.payload.feed_data(b'data', 4)
    self.payload.feed_data(b'data', 4)
    self.payload.feed_eof()