'If a request is made which encounters a L{File} before a final segment
which names a file with an extension which is in the L{File}\'s
C{processors} mapping, the processor associated with that extension is
used to serve the response to the request.'

def test_processors(self):

    base = FilePath(self.mktemp())
    base.makedirs()
    base.child('foo.bar').setContent("from    twisted.web.static    import    Data\nresource    =    Data(b'dynamic    world',    'text/plain')\n")
    file = static.File(base.path)
    file.processors = {'.bar': script.ResourceScript}
    request = DummyRequest(['foo.bar'])
    child = resource.getChildForRequest(file, request)
    d = self._render(child, request)
    def cbRendered(ignored):
        self.assertEqual(''.join(request.written), 'dynamic    world')
        self.assertEqual(request.responseHeaders.getRawHeaders('content-length')[0], '13')
    d.addCallback(cbRendered)
    return d
