'The C{\'PATH_INFO\'} key of the C{environ} C{dict} passed to the
application contains the suffix of the request URI path which is not
included in the value for the C{\'SCRIPT_NAME\'} key (RFC 3875, section
4.1.5).'

def test_pathInfo(self):

    assertKeyEmpty = self.environKeyEqual('PATH_INFO', '')
    root = self.render('GET', '1.1', [], [''])
    root.addCallback(self.environKeyEqual('PATH_INFO', '/'))
    emptyChild = self.render('GET', '1.1', [''], [''])
    emptyChild.addCallback(assertKeyEmpty)
    leaf = self.render('GET', '1.1', ['foo'], ['foo'])
    leaf.addCallback(assertKeyEmpty)
    container = self.render('GET', '1.1', ['foo', ''], ['foo', ''])
    container.addCallback(assertKeyEmpty)
    internalLeaf = self.render('GET', '1.1', ['foo'], ['foo', 'bar'])
    internalLeaf.addCallback(self.environKeyEqual('PATH_INFO', '/bar'))
    internalContainer = self.render('GET', '1.1', ['foo'], ['foo', ''])
    internalContainer.addCallback(self.environKeyEqual('PATH_INFO', '/'))
    unencoded = self.render('GET', '1.1', [], ['foo', '/', 'bar\xff'])
    unencoded.addCallback(self.environKeyEqual('PATH_INFO', '/foo///bar\xff'))
    return gatherResults([root, leaf, container, internalLeaf, internalContainer, unencoded])
