def test_bodyLength(self):
        """
        A correct response to a range request is as long as the length of the
        requested range.
        """
        self.request.requestHeaders.addRawHeader(b'range', b'bytes=0-43')
        self.resource.render(self.request)
        self.assertEqual(len(b''.join(self.request.written)), 44)

        A correct response to a range request is as long as the length of the
        requested range.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/web/test/test_static.py