Talk about os.stat and tracebacks instead of Nevow

This commit is contained in:
Jean-Paul Calderone 2020-10-21 10:01:57 -04:00
parent 2ba34a4759
commit 816ca79d8a

View File

@ -4767,11 +4767,9 @@ class Web(WebMixin, WebErrorMixin, testutil.StallMixin, testutil.ReallyEqualMixi
def test_static_missing(self):
# self.staticdir does not exist yet, because we used self.mktemp()
d = self.assertFailure(self.GET("/static"), error.Error)
# nevow.static throws an exception when it tries to os.stat the
# missing directory, which gives the client a 500 Internal Server
# Error, and the traceback reveals the parent directory name. By
# switching to plain twisted.web.static, this gives a normal 404 that
# doesn't reveal anything. This addresses #1720.
# If os.stat raises an exception for the missing directory and the
# traceback reveals the parent directory name we don't want to see
# that parent directory name in the response. This addresses #1720.
d.addCallback(lambda e: self.assertEquals(str(e), "404 Not Found"))
return d