def test_mutipleRangeSetsContentHeaders(self):
        """
        makeProducer when the Range header requests a single, satisfiable byte
        range sets the Content-* headers appropriately.
        """
        request = DummyRequest([])
        request.requestHeaders.addRawHeader(b'range', b'bytes=1-3,5-6')
        resource = self.makeResourceWithContent(
            b'abcdefghijkl', encoding='gzip')
        with resource.openForReading() as file:
            producer = resource.makeProducer(request, file)
            contentHeaders = self.contentHeaders(request)
            # The only content-* headers set are content-type and content-length.
            self.assertEqual(
                set([b'content-length', b'content-type']),
                set(contentHeaders.keys()))
            # The content-length depends on the boundary used in the response.
            expectedLength = 5
            for boundary, offset, size in producer.rangeInfo:
                expectedLength += len(boundary)
            self.assertEqual(intToBytes(expectedLength), contentHeaders[b'content-length'])
            # Content-type should be set to a value indicating a multipart
            # response and the boundary used to separate the parts.
            self.assertIn(b'content-type', contentHeaders)
            contentType = contentHeaders[b'content-type']
            self.assertNotIdentical(
                None, re.match(
                    b'multipart/byteranges; boundary="[^"]*"\Z', contentType))
            # Content-encoding is not set in the response to a multiple range
            # response, which is a bit wussy but works well enough with the way
            # static.File does content-encodings...
            self.assertNotIn(b'content-encoding', contentHeaders)

        makeProducer when the Range header requests a single, satisfiable byte
        range sets the Content-* headers appropriately.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/web/test/test_static.py