def test_face_root(self):
"""Verify that files outside of the package content web root
cannot be accessed, and that files inside can be."""
depot_url = self.dc.get_depot_url()
# Since /usr/share/lib/pkg/web/ is the content web root,
# any attempts to go outside that directory should fail
# with a 404 error.
try:
urlopen("{0}/../../../../bin/pkg".format(depot_url))
except HTTPError as e:
if e.code != http_client.NOT_FOUND:
raise
f = urlopen("{0}/robots.txt".format(depot_url))
self.assertTrue(len(f.read()))
f.close()
评论列表
文章目录