'Tests the body stream is emulated correctly.'

def test_stream(self):

    Channel(u'test').send({u'reply_channel': u'test', u'http_version': u'1.1', u'method': u'PUT', u'path': u'/', u'body': 'onetwothree', u'headers': {u'host': 'example.com', u'content-length': '11'}}, immediately=True)
    request = AsgiRequest(self.get_next_message(u'test', require=True))
    self.assertEqual(request.method, u'PUT')
    self.assertEqual(request.read(3), 'one')
    self.assertEqual(request.read(), 'twothree')
