Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_webob_jail(self):
request = webob.Request.blank('/path/to/filename.ext', {'SCRIPT_NAME': '/app/root'})
self.assertEqual(request.application_url, 'http://localhost/app/root')
self.assertEqual(request.url, 'http://localhost/app/root/path/to/filename.ext')
url = JailedURL(request)
self.assertEqual(str(url.chroot), 'http://localhost/app/root')
self.assertEqual(str(url), 'http://localhost/app/root/path/to/filename.ext')
def jailed(self):
return JailedURL(self, root=self)