def test_undecodablePath(self):
    '\n        A request whose path cannot be decoded as UTF-8 receives a not\n        found response, and the failure is logged.\n        '
    path = self.mktemp()
    if isinstance(path, bytes):
        path = path.decode('ascii')
    base = FilePath(path)
    base.makedirs()
    file = static.File(base.path)
    request = DummyRequest([b'\xff'])
    child = resource.getChildForRequest(file, request)
    d = self._render(child, request)

    def cbRendered(ignored):
        self.assertEqual(request.responseCode, 404)
        self.assertEqual(len(self.flushLoggedErrors(UnicodeDecodeError)), 1)
    d.addCallback(cbRendered)
    return d
A request whose path cannot be decoded as UTF-8 receives a not
found response, and the failure is logged.
def test_undecodablePath(self):
    '\n        A request whose path cannot be decoded as UTF-8 receives a not\n        found response, and the failure is logged.\n        '
    path = self.mktemp()
    if isinstance(path, bytes):
        path = path.decode('ascii')
    base = FilePath(path)
    base.makedirs()
    file = static.File(base.path)
    request = DummyRequest([b'\xff'])
    child = resource.getChildForRequest(file, request)
    d = self._render(child, request)

    def cbRendered(ignored):
        self.assertEqual(request.responseCode, 404)
        self.assertEqual(len(self.flushLoggedErrors(UnicodeDecodeError)), 1)
    d.addCallback(cbRendered)
    return d