def test_finishCalledWhenDone(self):
        """
        L{MultipleRangeStaticProducer.resumeProducing} calls finish() on the
        request after it is done producing content.
        """
        request = DummyRequest([])
        finishDeferred = request.notifyFinish()
        callbackList = []
        finishDeferred.addCallback(callbackList.append)
        producer = static.MultipleRangeStaticProducer(
            request, StringIO(b'abcdef'), [(b'', 1, 2)])
        # start calls registerProducer on the DummyRequest, which pulls all
        # output from the producer and so we just need this one call.
        producer.start()
        self.assertEqual([None], callbackList)

        L{MultipleRangeStaticProducer.resumeProducing} calls finish() on the
        request after it is done producing content.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/web/test/test_static.py