Changeset 2072
- Timestamp:
- 11/08/08 14:22:49
- Files:
-
- trunk/cherrypy/test/modfcgid.py (modified) (1 diff)
- trunk/cherrypy/test/modpy.py (modified) (3 diffs)
- trunk/cherrypy/test/modwsgi.py (modified) (1 diff)
- trunk/cherrypy/test/test_caching.py (modified) (1 diff)
- trunk/cherrypy/test/test_config.py (modified) (1 diff)
- trunk/cherrypy/test/test_core.py (modified) (8 diffs)
- trunk/cherrypy/test/test_encoding.py (modified) (1 diff)
- trunk/cherrypy/test/test_http.py (modified) (1 diff)
- trunk/cherrypy/test/test_httpauth.py (modified) (1 diff)
- trunk/cherrypy/test/test_objectmapping.py (modified) (1 diff)
- trunk/cherrypy/test/test_tools.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/cherrypy/test/modfcgid.py
r2025 r2072 105 105 106 106 def _run(self, conf): 107 cherrypy.server.using_apache = True 107 108 cherrypy.server.httpserver = servers.FlupFCGIServer( 108 109 application=cherrypy.tree, bindAddress=('127.0.0.1', 4000)) trunk/cherrypy/test/modpy.py
r1824 r2072 62 62 # Apache2 server conf file for testing CherryPy with modpython_gateway. 63 63 64 ServerName 127.0.0.1 64 65 DocumentRoot "/" 65 66 Listen %s … … 78 79 # Apache2 server conf file for testing CherryPy with _cpmodpy. 79 80 81 ServerName 127.0.0.1 80 82 DocumentRoot "/" 81 83 Listen %s … … 156 158 157 159 def _run(self, conf): 160 import cherrypy 161 cherrypy.server.using_apache = True 162 158 163 from cherrypy.test import webtest 159 164 webtest.WebCase.PORT = self.port trunk/cherrypy/test/modwsgi.py
r2017 r2072 117 117 118 118 def _run(self, conf): 119 cherrypy.server.using_apache = True 120 119 121 from cherrypy.test import webtest 120 122 webtest.WebCase.PORT = self.port trunk/cherrypy/test/test_caching.py
r1797 r2072 205 205 self.assertStatus(304) 206 206 self.assertNoHeader("Last-Modified") 207 self.assertHeader("Age") 207 if not getattr(cherrypy.server, "using_apache", False): 208 self.assertHeader("Age") 208 209 209 210 trunk/cherrypy/test/test_config.py
r1724 r2072 171 171 self.assertBody(repr(cherrypy.lib.http.response_codes[404])) 172 172 173 self.getPage("/repr?key=thing2") 174 from cherrypy.tutorial import thing2 175 self.assertBody(repr(thing2)) 173 if not getattr(cherrypy.server, "using_apache", False): 174 # The object ID's won't match up when using Apache, since the 175 # server and client are running in different processes. 176 self.getPage("/repr?key=thing2") 177 from cherrypy.tutorial import thing2 178 self.assertBody(repr(thing2)) 176 179 177 180 self.getPage("/repr?key=complex") trunk/cherrypy/test/test_core.py
r2070 r2072 18 18 19 19 defined_http_methods = ("OPTIONS", "GET", "HEAD", "POST", "PUT", "DELETE", 20 "TRACE", " CONNECT", "PROPFIND")20 "TRACE", "PROPFIND") 21 21 22 22 … … 385 385 def index(self): 386 386 m = cherrypy.request.method 387 if m in defined_http_methods :387 if m in defined_http_methods or m == "CONNECT": 388 388 return m 389 389 … … 589 589 self.assertErrorPage(500, msg) 590 590 591 self.getPage("/status/unknown") 592 self.assertBody('funky') 593 self.assertStatus(431) 591 if not getattr(cherrypy.server, 'using_apache', False): 592 self.getPage("/status/unknown") 593 self.assertBody('funky') 594 self.assertStatus(431) 594 595 595 596 self.getPage("/status/bad") … … 753 754 self.assertErrorPage(500, pattern=valerr) 754 755 755 if cherrypy.server.protocol_version == "HTTP/1.0": 756 if (cherrypy.server.protocol_version == "HTTP/1.0" or 757 getattr(cherrypy.server, "using_apache", False)): 756 758 self.getPage("/error/page_streamed") 757 759 # Because this error is raised after the response body has … … 796 798 self.assertInBody(msg) 797 799 798 if (hasattr(self, 'harness') and 799 "modpython" in self.harness.__class__.__name__.lower()): 800 if getattr(cherrypy.server, "using_apache", False): 800 801 pass 801 802 else: … … 961 962 self.assertBody("application/json") 962 963 963 def test HTTPMethods(self):964 def test_basic_HTTPMethods(self): 964 965 helper.webtest.methods_with_bodies = ("POST", "PUT", "PROPFIND") 965 966 … … 1046 1047 self.assertStatus(200) 1047 1048 1049 def test_CONNECT_method(self): 1050 if getattr(cherrypy.server, "using_apache", False): 1051 print "skipped due to known Apache differences...", 1052 return 1053 1054 self.getPage("/method/", method="CONNECT") 1055 self.assertBody("CONNECT") 1056 1048 1057 def testFavicon(self): 1049 1058 # favicon.ico is served by staticfile. … … 1079 1088 1080 1089 def testMaxRequestSize(self): 1090 if getattr(cherrypy.server, "using_apache", False): 1091 print "skipped due to known Apache differences...", 1092 return 1093 1081 1094 for size in (500, 5000, 50000): 1082 1095 self.getPage("/", headers=[('From', "x" * 500)]) trunk/cherrypy/test/test_encoding.py
r2070 r2072 155 155 # and 2) we may have already written some of the body. 156 156 # The fix is to never stream yields when using gzip. 157 if cherrypy.server.protocol_version == "HTTP/1.0": 157 if (cherrypy.server.protocol_version == "HTTP/1.0" or 158 getattr(cherrypy.server, "using_apache", False)): 158 159 self.getPage('/gzip/noshow_stream', 159 160 headers=[("Accept-Encoding", "gzip")]) trunk/cherrypy/test/test_http.py
r2041 r2072 105 105 106 106 def test_malformed_request_line(self): 107 if getattr(cherrypy.server, "using_apache", False): 108 print "skipped due to known Apache differences...", 109 return 110 107 111 # Test missing version in Request-Line 108 112 if self.scheme == 'https': trunk/cherrypy/test/test_httpauth.py
r1891 r2072 139 139 auth = base_auth % (nonce, response, '00000001') 140 140 self.getPage('/digest/', [('Authorization', auth)]) 141 self.assertStatus( '401 Unauthorized')141 self.assertStatus(401) 142 142 143 143 # Test that must pass trunk/cherrypy/test/test_objectmapping.py
r2051 r2072 221 221 self.assertHeader('Location', '%s/dir1/' % self.base()) 222 222 223 # Test that we can use URL's which aren't all valid Python identifiers 224 # This should also test the %XX-unquoting of URL's. 225 self.getPage("/Von%20B%fclow?ID=14") 226 self.assertBody("ID is 14") 227 228 # Test that %2F in the path doesn't get unquoted too early; 229 # that is, it should not be used to separate path components. 230 # See ticket #393. 231 self.getPage("/page%2Fname") 232 self.assertBody("default:('page/name',)") 223 if not getattr(cherrypy.server, "using_apache", False): 224 # Test that we can use URL's which aren't all valid Python identifiers 225 # This should also test the %XX-unquoting of URL's. 226 self.getPage("/Von%20B%fclow?ID=14") 227 self.assertBody("ID is 14") 228 229 # Test that %2F in the path doesn't get unquoted too early; 230 # that is, it should not be used to separate path components. 231 # See ticket #393. 232 self.getPage("/page%2Fname") 233 self.assertBody("default:('page/name',)") 233 234 234 235 self.getPage("/dir1/dir2/script_name") trunk/cherrypy/test/test_tools.py
r2070 r2072 264 264 265 265 # If body is "razdrez", then on_end_request is being called too early. 266 if cherrypy.server.protocol_version == "HTTP/1.0": 266 if (cherrypy.server.protocol_version == "HTTP/1.0" or 267 getattr(cherrypy.server, "using_apache", False)): 267 268 self.getPage("/demo/errinstream?id=5") 268 269 # Because this error is raised after the response body has

