Ejemplo n.º 1
0
 def test_cgi_root_fix_custom_app_root(self):
     app = fixers.CGIRootFix(path_check_app, app_root='/baz/poop/')
     response = Response.from_app(app, dict(create_environ(),
         SCRIPT_NAME='/foo',
         PATH_INFO='/bar'
     ))
     self.assert_equal(response.get_data(), b'PATH_INFO: /foo/bar\nSCRIPT_NAME: baz/poop')
Ejemplo n.º 2
0
 def test_cgi_root_fix(self):
     app = fixers.CGIRootFix(path_check_app)
     response = Response.from_app(app, dict(create_environ(),
         SCRIPT_NAME='/foo',
         PATH_INFO='/bar',
         SERVER_SOFTWARE='lighttpd/1.4.27'
     ))
     assert response.data == b'PATH_INFO: /foo/bar\nSCRIPT_NAME: '
Ejemplo n.º 3
0
 def test_cgi_root_fix_custom_app_root(self):
     app = fixers.CGIRootFix(path_check_app, app_root="/baz/")
     response = Response.from_app(
         app, dict(create_environ(), SCRIPT_NAME="/foo", PATH_INFO="/bar"))
     assert response.get_data() == b"PATH_INFO: /bar\nSCRIPT_NAME: baz"
Ejemplo n.º 4
0
 def test_cgi_root_fix(self):
     app = fixers.CGIRootFix(path_check_app)
     response = Response.from_app(
         app, dict(create_environ(), SCRIPT_NAME='/foo', PATH_INFO='/bar'))
     assert response.get_data() == b'PATH_INFO: /bar\nSCRIPT_NAME: '